@cryptotaxi247 / netdata-1 / commits / 03fd9e7ab

Update metadata.yaml for some python collectors (#15510)

* Update metadata.yaml for some python collectors --------- Co-authored-by: Fotis Voutsas <fotis@netdata.cloud>

Andrew Maguire committed Jul 26, 2023 at 12:26 UTC 03fd9e7ab35e726f25f83d2b733b0feaaf16bc72
6 files changed +412 -76
collectors/python.d.plugin/alarms/metadata.yaml
+134 -34
@@ -1,53 +1,152 @@
1 +# yamllint disable rule:line-length
2 +---
3 meta:
4 plugin_name: python.d.plugin
5 module_name: alarms
6 monitored_instance:
7 name: python.d alarms
6 - link: ''
7 - categories: []
8 - icon_filename: ''
8 + link: https://learn.netdata.cloud/docs/data-collection/netdata-specific/alarms
9 + categories:
10 + - data-collection.other
11 + icon_filename: ""
12 related_resources:
13 integrations:
14 list: []
15 info_provided_to_referring_integrations:
13 - description: ''
14 - keywords: []
16 + description: ""
17 + keywords:
18 + - alarms
19 + - netdata
20 most_popular: false
21 overview:
22 data_collection:
18 - metrics_description: ''
19 - method_description: ''
23 + metrics_description: |
24 + This collector creates an 'Alarms' menu with one line plot of `alarms.status`.
25 + method_description: |
26 + Alarm status is read from the Netdata agent rest api [`/api/v1/alarms?all`](https://learn.netdata.cloud/api#/alerts/alerts1).
27 supported_platforms:
28 include: []
29 exclude: []
30 multi_instance: true
31 additional_permissions:
25 - description: ''
32 + description: ""
33 default_behavior:
34 auto_detection:
28 - description: ''
35 + description: |
36 + It discovers instances of Netdata running on localhost, and gathers metrics from `http://127.0.0.1:19999/api/v1/alarms?all`. `CLEAR` status is mapped to `0`, `WARNING` to `1` and `CRITICAL` to `2`. Also, by default all alarms produced will be monitored.
37 limits:
30 - description: ''
38 + description: ""
39 performance_impact:
32 - description: ''
40 + description: ""
41 setup:
42 prerequisites:
43 list: []
44 configuration:
45 file:
38 - name: ''
39 - description: ''
46 + name: python.d/alarms.conf
47 + description: ""
48 options:
41 - description: ''
49 + description: |
50 + There are 2 sections:
51 +
52 + * Global variables
53 + * One or more JOBS that can define multiple different instances to monitor.
54 +
55 + The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
56 +
57 + Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
58 +
59 + Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
60 folding:
43 - title: ''
61 + title: Config options
62 enabled: true
45 - list: []
63 + list:
64 + - name: url
65 + description: Netdata agent alarms endpoint to collect from. Can be local or remote so long as reachable by agent.
66 + default_value: http://127.0.0.1:19999/api/v1/alarms?all
67 + required: true
68 + - name: status_map
69 + description: Mapping of alarm status to integer number that will be the metric value collected.
70 + default_value: '{"CLEAR": 0, "WARNING": 1, "CRITICAL": 2}'
71 + required: true
72 + - name: collect_alarm_values
73 + description: set to true to include a chart with calculated alarm values over time.
74 + default_value: false
75 + required: true
76 + - name: alarm_status_chart_type
77 + description: define the type of chart for plotting status over time e.g. 'line' or 'stacked'.
78 + default_value: "line"
79 + required: true
80 + - name: alarm_contains_words
81 + description: >
82 + A "," separated list of words you want to filter alarm names for. For example 'cpu,load' would filter for only alarms with "cpu" or "load" in alarm name. Default includes all.
83 + default_value: ""
84 + required: true
85 + - name: alarm_excludes_words
86 + description: >
87 + A "," separated list of words you want to exclude based on alarm name. For example 'cpu,load' would exclude all alarms with "cpu" or "load" in alarm name. Default excludes None.
88 + default_value: ""
89 + required: true
90 + - name: update_every
91 + description: Sets the default data collection frequency.
92 + default_value: 10
93 + required: false
94 + - name: priority
95 + description: Controls the order of charts at the netdata dashboard.
96 + default_value: 60000
97 + required: false
98 + - name: autodetection_retry
99 + description: Sets the job re-check interval in seconds.
100 + default_value: 0
101 + required: false
102 + - name: penalty
103 + description: Indicates whether to apply penalty to update_every in case of failures.
104 + default_value: yes
105 + required: false
106 + - name: name
107 + description: Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works.
108 + default_value: ""
109 + required: false
110 examples:
111 folding:
112 enabled: true
49 - title: ''
50 - list: []
113 + title: Config
114 + list:
115 + - name: Basic
116 + folding:
117 + enabled: false
118 + description: A basic example configuration.
119 + config: |
120 + jobs:
121 + url: 'http://127.0.0.1:19999/api/v1/alarms?all'
122 + - name: Advanced
123 + folding:
124 + enabled: true
125 + description: |
126 + An advanced example configuration with multiple jobs collecting different subsets of alarms for plotting on different charts.
127 + "ML" job will collect status and values for all alarms with "ml_" in the name. Default job will collect status for all other alarms.
128 + config: |
129 + ML:
130 + update_every: 5
131 + url: 'http://127.0.0.1:19999/api/v1/alarms?all'
132 + status_map:
133 + CLEAR: 0
134 + WARNING: 1
135 + CRITICAL: 2
136 + collect_alarm_values: true
137 + alarm_status_chart_type: 'stacked'
138 + alarm_contains_words: 'ml_'
139 +
140 + Default:
141 + update_every: 5
142 + url: 'http://127.0.0.1:19999/api/v1/alarms?all'
143 + status_map:
144 + CLEAR: 0
145 + WARNING: 1
146 + CRITICAL: 2
147 + collect_alarm_values: false
148 + alarm_status_chart_type: 'stacked'
149 + alarm_excludes_words: 'ml_'
150 troubleshooting:
151 problems:
152 list: []
@@ -59,19 +158,20 @@ metrics:
158 description: ""
159 availability: []
160 scopes:
62 - - name: global
63 - description: ""
64 - labels: []
65 - metrics:
66 - - name: alarms.status
67 - description: Alarms ({status mapping})
68 - unit: "status"
69 - chart_type: line
70 - dimensions:
71 - - name: a dimension per alarm
72 - - name: alarms.status
73 - description: Alarm Values
74 - unit: "value"
75 - chart_type: line
76 - dimensions:
77 - - name: a dimension per alarm
161 + - name: global
162 + description: |
163 + These metrics refer to the entire monitored application.
164 + labels: []
165 + metrics:
166 + - name: alarms.status
167 + description: Alarms ({status mapping})
168 + unit: "status"
169 + chart_type: line
170 + dimensions:
171 + - name: a dimension per alarm representing the latest status of the alarm.
172 + - name: alarms.values
173 + description: Alarm Values
174 + unit: "value"
175 + chart_type: line
176 + dimensions:
177 + - name: a dimension per alarm representing the latest collected value of the alarm.
collectors/python.d.plugin/alarms/metrics.csv
+1 -1
@@ -1,3 +1,3 @@
1 metric,scope,dimensions,unit,description,chart_type,labels,plugin,module
2 alarms.status,,a dimension per alarm,status,Alarms ({status mapping}),line,,python.d.plugin,alarms
3 -alarms.status,,a dimension per alarm,value,Alarm Values,line,,python.d.plugin,alarms
3 +alarms.value,,a dimension per alarm,value,Alarm Values,line,,python.d.plugin,alarms
collectors/python.d.plugin/example/metadata.yaml new
+138
@@ -0,0 +1,138 @@
1 +# yamllint disable rule:line-length
2 +---
3 +meta:
4 + plugin_name: python.d.plugin
5 + module_name: example
6 + monitored_instance:
7 + name: python.d alarms
8 + link: https://learn.netdata.cloud/docs/data-collection/examples/example-module-in-python
9 + categories:
10 + - data-collection.other
11 + icon_filename: ""
12 + related_resources:
13 + integrations:
14 + list: []
15 + info_provided_to_referring_integrations:
16 + description: ""
17 + keywords:
18 + - example
19 + - netdata
20 + - python
21 + most_popular: false
22 +overview:
23 + data_collection:
24 + metrics_description: |
25 + Example collector that generates some random numbers as metrics.
26 +
27 + If you want to write your own collector, read our [writing a new Python module](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/README.md#how-to-write-a-new-module) tutorial.
28 + method_description: |
29 + The `get_data()` function uses `random.randint()` to generate a random number which will be collected as a metric.
30 + supported_platforms:
31 + include: []
32 + exclude: []
33 + multi_instance: true
34 + additional_permissions:
35 + description: ""
36 + default_behavior:
37 + auto_detection:
38 + description: ""
39 + limits:
40 + description: ""
41 + performance_impact:
42 + description: ""
43 +setup:
44 + prerequisites:
45 + list: []
46 + configuration:
47 + file:
48 + name: python.d/example.conf
49 + description: ""
50 + options:
51 + description: |
52 + There are 2 sections:
53 +
54 + * Global variables
55 + * One or more JOBS that can define multiple different instances to monitor.
56 +
57 + The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
58 +
59 + Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
60 +
61 + Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
62 + folding:
63 + title: Config options
64 + enabled: true
65 + list:
66 + - name: num_lines
67 + description: The number of lines to create.
68 + default_value: 4
69 + required: false
70 + - name: lower
71 + description: The lower bound of numbers to randomly sample from.
72 + default_value: 0
73 + required: false
74 + - name: upper
75 + description: The upper bound of numbers to randomly sample from.
76 + default_value: 100
77 + required: false
78 + - name: update_every
79 + description: Sets the default data collection frequency.
80 + default_value: 1
81 + required: false
82 + - name: priority
83 + description: Controls the order of charts at the netdata dashboard.
84 + default_value: 60000
85 + required: false
86 + - name: autodetection_retry
87 + description: Sets the job re-check interval in seconds.
88 + default_value: 0
89 + required: false
90 + - name: penalty
91 + description: Indicates whether to apply penalty to update_every in case of failures.
92 + default_value: yes
93 + required: false
94 + - name: name
95 + description: Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works.
96 + default_value: ""
97 + required: false
98 + examples:
99 + folding:
100 + enabled: true
101 + title: Config
102 + list:
103 + - name: Basic
104 + folding:
105 + enabled: false
106 + description: A basic example configuration.
107 + config: |
108 + four_lines:
109 + name: "Four Lines"
110 + update_every: 1
111 + priority: 60000
112 + penalty: yes
113 + autodetection_retry: 0
114 + num_lines: 4
115 + lower: 0
116 + upper: 100
117 +troubleshooting:
118 + problems:
119 + list: []
120 +alerts: []
121 +metrics:
122 + folding:
123 + title: Metrics
124 + enabled: false
125 + description: ""
126 + availability: []
127 + scopes:
128 + - name: global
129 + description: |
130 + These metrics refer to the entire monitored application.
131 + labels: []
132 + metrics:
133 + - name: example.random
134 + description: A random number
135 + unit: number
136 + chart_type: line
137 + dimensions:
138 + - random: a dimension per `num_lines`.
collectors/python.d.plugin/example/metrics.csv new
+2
@@ -0,0 +1,2 @@
1 +metric,scope,dimensions,unit,description,chart_type,labels,plugin,module
2 +example.random,,a dimension per `num_lines`,,A random number,line,,python.d.plugin,example
collectors/python.d.plugin/fail2ban/metadata.yaml
+136 -40
@@ -1,54 +1,149 @@
1 +# yamllint disable rule:line-length
2 +---
3 meta:
4 plugin_name: python.d.plugin
5 module_name: fail2ban
6 monitored_instance:
7 name: Fail2ban
6 - link: ''
8 + link: https://www.fail2ban.org/
9 categories:
8 - - data-collection.authentication-and-authorization
9 - icon_filename: 'fail2ban.png'
10 + - data-collection.authentication-and-authorization
11 + icon_filename: "fail2ban.png"
12 related_resources:
13 integrations:
14 list: []
15 info_provided_to_referring_integrations:
14 - description: ''
15 - keywords: []
16 + description: ""
17 + keywords:
18 + - fail2ban
19 + - security
20 + - authentication
21 + - authorization
22 most_popular: false
23 overview:
24 data_collection:
19 - metrics_description: 'Monitor Fail2ban performance for prime intrusion prevention operations. Monitor ban counts, jail statuses, and failed login attempts to ensure robust network security.'
20 - method_description: ''
25 + metrics_description: |
26 + Monitor Fail2ban performance for prime intrusion prevention operations. Monitor ban counts, jail statuses, and failed login attempts to ensure robust network security.
27 + method_description: |
28 + It collects metrics through reading the default log and configuration files of fail2ban.
29 supported_platforms:
30 include: []
31 exclude: []
32 multi_instance: true
33 additional_permissions:
26 - description: ''
34 + description: |
35 + The `fail2ban.log` file must be readable by the user `netdata`.
36 + - change the file ownership and access permissions.
37 + - update `/etc/logrotate.d/fail2ban`` to persist the changes after rotating the log file.
38 +
39 + To change the file ownership and access permissions, execute the following:
40 +
41 + ```shell
42 + sudo chown root:netdata /var/log/fail2ban.log
43 + sudo chmod 640 /var/log/fail2ban.log
44 + ```
45 +
46 + To persist the changes after rotating the log file, add `create 640 root netdata` to the `/etc/logrotate.d/fail2ban`:
47 +
48 + ```shell
49 + /var/log/fail2ban.log {
50 +
51 + weekly
52 + rotate 4
53 + compress
54 +
55 + delaycompress
56 + missingok
57 + postrotate
58 + fail2ban-client flushlogs 1>/dev/null
59 + endscript
60 +
61 + # If fail2ban runs as non-root it still needs to have write access
62 + # to logfiles.
63 + # create 640 fail2ban adm
64 + create 640 root netdata
65 + }
66 + ```
67 default_behavior:
68 auto_detection:
29 - description: ''
69 + description: |
70 + By default the collector will attempt to read log file at /var/log/fail2ban.log and conf file at /etc/fail2ban/jail.local. If conf file is not found default jail is ssh.
71 limits:
31 - description: ''
72 + description: ""
73 performance_impact:
33 - description: ''
74 + description: ""
75 setup:
76 prerequisites:
77 list: []
78 configuration:
79 file:
39 - name: ''
40 - description: ''
80 + name: ""
81 + description: ""
82 options:
42 - description: ''
83 + description: |
84 + There are 2 sections:
85 +
86 + * Global variables
87 + * One or more JOBS that can define multiple different instances to monitor.
88 +
89 + The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
90 +
91 + Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
92 +
93 + Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
94 folding:
44 - title: ''
95 + title: Config options
96 enabled: true
46 - list: []
97 + list:
98 + - name: log_path
99 + description: path to fail2ban.log.
100 + default_value: /var/log/fail2ban.log
101 + required: false
102 + - name: conf_path
103 + description: path to jail.local/jail.conf.
104 + default_value: /etc/fail2ban/jail.local
105 + required: false
106 + - name: conf_dir
107 + description: path to jail.d/.
108 + default_value: /etc/fail2ban/jail.d/
109 + required: false
110 + - name: exclude
111 + description: jails you want to exclude from autodetection.
112 + default_value: ""
113 + required: false
114 + - name: update_every
115 + description: Sets the default data collection frequency.
116 + default_value: 1
117 + required: false
118 + - name: priority
119 + description: Controls the order of charts at the netdata dashboard.
120 + default_value: 60000
121 + required: false
122 + - name: autodetection_retry
123 + description: Sets the job re-check interval in seconds.
124 + default_value: 0
125 + required: false
126 + - name: penalty
127 + description: Indicates whether to apply penalty to update_every in case of failures.
128 + default_value: yes
129 + required: false
130 + - name: name
131 + description: Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works.
132 + default_value: ""
133 + required: false
134 examples:
135 folding:
136 enabled: true
50 - title: ''
51 - list: []
137 + title: Config
138 + list:
139 + - name: Basic
140 + folding:
141 + enabled: false
142 + description: A basic example configuration.
143 + config: |
144 + local:
145 + log_path: '/var/log/fail2ban.log'
146 + conf_path: '/etc/fail2ban/jail.local'
147 troubleshooting:
148 problems:
149 list: []
@@ -60,25 +155,26 @@ metrics:
155 description: ""
156 availability: []
157 scopes:
63 - - name: global
64 - description: ""
65 - labels: []
66 - metrics:
67 - - name: fail2ban.faile_attempts
68 - description: Failed attempts
69 - unit: "attempts/s"
70 - chart_type: line
71 - dimensions:
72 - - name: a dimension per jail
73 - - name: fail2ban.bans
74 - description: Bans
75 - unit: "bans/s"
76 - chart_type: line
77 - dimensions:
78 - - name: a dimension per jail
79 - - name: fail2ban.banned_ips
80 - description: Banned IP addresses (since the last restart of netdata)
81 - unit: "ips"
82 - chart_type: line
83 - dimensions:
84 - - name: a dimension per jail
158 + - name: global
159 + description: |
160 + These metrics refer to the entire monitored application.
161 + labels: []
162 + metrics:
163 + - name: fail2ban.failed_attempts
164 + description: Failed attempts
165 + unit: "attempts/s"
166 + chart_type: line
167 + dimensions:
168 + - name: a dimension per jail
169 + - name: fail2ban.bans
170 + description: Bans
171 + unit: "bans/s"
172 + chart_type: line
173 + dimensions:
174 + - name: a dimension per jail
175 + - name: fail2ban.banned_ips
176 + description: Banned IP addresses (since the last restart of netdata)
177 + unit: "ips"
178 + chart_type: line
179 + dimensions:
180 + - name: a dimension per jail
collectors/python.d.plugin/fail2ban/metrics.csv
+1 -1
@@ -1,4 +1,4 @@
1 metric,scope,dimensions,unit,description,chart_type,labels,plugin,module
2 -fail2ban.faile_attempts,,a dimension per jail,attempts/s,Failed attempts,line,,python.d.plugin,fail2ban
2 +fail2ban.failed_attempts,,a dimension per jail,attempts/s,Failed attempts,line,,python.d.plugin,fail2ban
3 fail2ban.bans,,a dimension per jail,bans/s,Bans,line,,python.d.plugin,fail2ban
4 fail2ban.banned_ips,,a dimension per jail,ips,Banned IP addresses (since the last restart of netdata),line,,python.d.plugin,fail2ban