@cryptotaxi247 / netdata-1 / commits / 6fc65d053

remove python.d/fail2ban (#17502)

* remove python.d/fail2ban * disable in python.d.conf

Ilya Mashchenko committed Apr 23, 2024 at 20:00 UTC 6fc65d05343398f07a5f36ba2061e3b512293821
7 files changed +3 -700
CMakeLists.txt
-2
@@ -2551,7 +2551,6 @@ install(FILES
2551 src/collectors/python.d.plugin/dovecot/dovecot.conf
2552 src/collectors/python.d.plugin/example/example.conf
2553 src/collectors/python.d.plugin/exim/exim.conf
2554 - src/collectors/python.d.plugin/fail2ban/fail2ban.conf
2554 src/collectors/python.d.plugin/gearman/gearman.conf
2555 src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2556 src/collectors/python.d.plugin/haproxy/haproxy.conf
@@ -2598,7 +2597,6 @@ install(FILES
2597 src/collectors/python.d.plugin/dovecot/dovecot.chart.py
2598 src/collectors/python.d.plugin/example/example.chart.py
2599 src/collectors/python.d.plugin/exim/exim.chart.py
2601 - src/collectors/python.d.plugin/fail2ban/fail2ban.chart.py
2600 src/collectors/python.d.plugin/gearman/gearman.chart.py
2601 src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2602 src/collectors/python.d.plugin/haproxy/haproxy.chart.py
src/collectors/python.d.plugin/fail2ban/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/fail2ban.md
\ No newline at end of file
src/collectors/python.d.plugin/fail2ban/fail2ban.chart.py deleted
-217
@@ -1,217 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: fail2ban log netdata python.d module
3 -# Author: ilyam8
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import os
7 -import re
8 -from collections import defaultdict
9 -from glob import glob
10 -
11 -from bases.FrameworkServices.LogService import LogService
12 -
13 -ORDER = [
14 - 'jails_failed_attempts',
15 - 'jails_bans',
16 - 'jails_banned_ips',
17 -]
18 -
19 -
20 -def charts(jails):
21 - """
22 - Chart definitions creating
23 - """
24 -
25 - ch = {
26 - ORDER[0]: {
27 - 'options': [None, 'Failed attempts', 'attempts/s', 'failed attempts', 'fail2ban.failed_attempts', 'line'],
28 - 'lines': []
29 - },
30 - ORDER[1]: {
31 - 'options': [None, 'Bans', 'bans/s', 'bans', 'fail2ban.bans', 'line'],
32 - 'lines': []
33 - },
34 - ORDER[2]: {
35 - 'options': [None, 'Banned IP addresses (since the last restart of netdata)', 'ips', 'banned ips',
36 - 'fail2ban.banned_ips', 'line'],
37 - 'lines': []
38 - },
39 - }
40 - for jail in jails:
41 - dim = ['{0}_failed_attempts'.format(jail), jail, 'incremental']
42 - ch[ORDER[0]]['lines'].append(dim)
43 -
44 - dim = [jail, jail, 'incremental']
45 - ch[ORDER[1]]['lines'].append(dim)
46 -
47 - dim = ['{0}_in_jail'.format(jail), jail, 'absolute']
48 - ch[ORDER[2]]['lines'].append(dim)
49 -
50 - return ch
51 -
52 -
53 -RE_JAILS = re.compile(r'\[([a-zA-Z0-9_-]+)\][^\[\]]+?enabled\s+= +(true|yes|false|no)')
54 -
55 -ACTION_BAN = 'Ban'
56 -ACTION_UNBAN = 'Unban'
57 -ACTION_RESTORE_BAN = 'Restore Ban'
58 -ACTION_FOUND = 'Found'
59 -
60 -# Example:
61 -# 2018-09-12 11:45:58,727 fail2ban.actions[25029]: WARNING [ssh] Found 203.0.113.1
62 -# 2018-09-12 11:45:58,727 fail2ban.actions[25029]: WARNING [ssh] Ban 203.0.113.1
63 -# 2018-09-12 11:45:58,727 fail2ban.actions[25029]: WARNING [ssh] Restore Ban 203.0.113.1
64 -# 2018-09-12 11:45:53,715 fail2ban.actions[25029]: WARNING [ssh] Unban 203.0.113.1
65 -RE_DATA = re.compile(
66 - r'\[(?P<jail>[A-Za-z-_0-9]+)\] (?P<action>{0}|{1}|{2}|{3}) (?P<ip>[a-f0-9.:]+)'.format(
67 - ACTION_BAN, ACTION_UNBAN, ACTION_RESTORE_BAN, ACTION_FOUND
68 - )
69 -)
70 -
71 -DEFAULT_JAILS = [
72 - 'ssh',
73 -]
74 -
75 -
76 -class Service(LogService):
77 - def __init__(self, configuration=None, name=None):
78 - LogService.__init__(self, configuration=configuration, name=name)
79 - self.order = ORDER
80 - self.definitions = dict()
81 - self.log_path = self.configuration.get('log_path', '/var/log/fail2ban.log')
82 - self.conf_path = self.configuration.get('conf_path', '/etc/fail2ban/jail.local')
83 - self.conf_dir = self.configuration.get('conf_dir', '/etc/fail2ban/jail.d/')
84 - self.exclude = self.configuration.get('exclude', str())
85 - self.monitoring_jails = list()
86 - self.banned_ips = defaultdict(set)
87 - self.data = dict()
88 -
89 - def check(self):
90 - """
91 - :return: bool
92 - """
93 - if not self.conf_path.endswith(('.conf', '.local')):
94 - self.error('{0} is a wrong conf path name, must be *.conf or *.local'.format(self.conf_path))
95 - return False
96 -
97 - if not os.access(self.log_path, os.R_OK):
98 - self.error('{0} is not readable'.format(self.log_path))
99 - return False
100 -
101 - if os.path.getsize(self.log_path) == 0:
102 - self.error('{0} is empty'.format(self.log_path))
103 - return False
104 -
105 - self.monitoring_jails = self.jails_auto_detection()
106 - for jail in self.monitoring_jails:
107 - self.data['{0}_failed_attempts'.format(jail)] = 0
108 - self.data[jail] = 0
109 - self.data['{0}_in_jail'.format(jail)] = 0
110 -
111 - self.definitions = charts(self.monitoring_jails)
112 - self.info('monitoring jails: {0}'.format(self.monitoring_jails))
113 -
114 - return True
115 -
116 - def get_data(self):
117 - """
118 - :return: dict
119 - """
120 - raw = self._get_raw_data()
121 -
122 - if not raw:
123 - return None if raw is None else self.data
124 -
125 - for row in raw:
126 - match = RE_DATA.search(row)
127 -
128 - if not match:
129 - continue
130 -
131 - match = match.groupdict()
132 -
133 - if match['jail'] not in self.monitoring_jails:
134 - continue
135 -
136 - jail, action, ip = match['jail'], match['action'], match['ip']
137 -
138 - if action == ACTION_FOUND:
139 - self.data['{0}_failed_attempts'.format(jail)] += 1
140 - elif action in (ACTION_BAN, ACTION_RESTORE_BAN):
141 - self.data[jail] += 1
142 - if ip not in self.banned_ips[jail]:
143 - self.banned_ips[jail].add(ip)
144 - self.data['{0}_in_jail'.format(jail)] += 1
145 - elif action == ACTION_UNBAN:
146 - if ip in self.banned_ips[jail]:
147 - self.banned_ips[jail].remove(ip)
148 - self.data['{0}_in_jail'.format(jail)] -= 1
149 -
150 - return self.data
151 -
152 - def get_files_from_dir(self, dir_path, suffix):
153 - """
154 - :return: list
155 - """
156 - if not os.path.isdir(dir_path):
157 - self.error('{0} is not a directory'.format(dir_path))
158 - return list()
159 -
160 - return glob('{0}/*.{1}'.format(self.conf_dir, suffix))
161 -
162 - def get_jails_from_file(self, file_path):
163 - """
164 - :return: list
165 - """
166 - if not os.access(file_path, os.R_OK):
167 - self.error('{0} is not readable or not exist'.format(file_path))
168 - return list()
169 -
170 - with open(file_path, 'rt') as f:
171 - lines = f.readlines()
172 - raw = ' '.join(line for line in lines if line.startswith(('[', 'enabled')))
173 -
174 - match = RE_JAILS.findall(raw)
175 - # Result: [('ssh', 'true'), ('dropbear', 'true'), ('pam-generic', 'true'), ...]
176 -
177 - if not match:
178 - self.debug('{0} parse failed'.format(file_path))
179 - return list()
180 -
181 - return match
182 -
183 - def jails_auto_detection(self):
184 - """
185 - :return: list
186 -
187 - Parses jail configuration files. Returns list of enabled jails.
188 - According man jail.conf parse order must be
189 - * jail.conf
190 - * jail.d/*.conf (in alphabetical order)
191 - * jail.local
192 - * jail.d/*.local (in alphabetical order)
193 - """
194 - jails_files, all_jails, active_jails = list(), list(), list()
195 -
196 - jails_files.append('{0}.conf'.format(self.conf_path.rsplit('.')[0]))
197 - jails_files.extend(self.get_files_from_dir(self.conf_dir, 'conf'))
198 - jails_files.append('{0}.local'.format(self.conf_path.rsplit('.')[0]))
199 - jails_files.extend(self.get_files_from_dir(self.conf_dir, 'local'))
200 -
201 - self.debug('config files to parse: {0}'.format(jails_files))
202 -
203 - for f in jails_files:
204 - all_jails.extend(self.get_jails_from_file(f))
205 -
206 - exclude = self.exclude.split()
207 -
208 - for name, status in all_jails:
209 - if name in exclude:
210 - continue
211 -
212 - if status in ('true', 'yes') and name not in active_jails:
213 - active_jails.append(name)
214 - elif status in ('false', 'no') and name in active_jails:
215 - active_jails.remove(name)
216 -
217 - return active_jails or DEFAULT_JAILS
src/collectors/python.d.plugin/fail2ban/fail2ban.conf deleted
-68
@@ -1,68 +0,0 @@
1 -# netdata python.d.plugin configuration for fail2ban
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -# There are 2 sections:
8 -# - global variables
9 -# - one or more JOBS
10 -#
11 -# JOBS allow you to collect values from multiple sources.
12 -# Each source will have its own set of charts.
13 -#
14 -# JOB parameters have to be indented (using spaces only, example below).
15 -
16 -# ----------------------------------------------------------------------
17 -# Global Variables
18 -# These variables set the defaults for all JOBs, however each JOB
19 -# may define its own, overriding the defaults.
20 -
21 -# update_every sets the default data collection frequency.
22 -# If unset, the python.d.plugin default is used.
23 -# update_every: 1
24 -
25 -# priority controls the order of charts at the netdata dashboard.
26 -# Lower numbers move the charts towards the top of the page.
27 -# If unset, the default for python.d.plugin is used.
28 -# priority: 60000
29 -
30 -# penalty indicates whether to apply penalty to update_every in case of failures.
31 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
32 -# penalty: yes
33 -
34 -# autodetection_retry sets the job re-check interval in seconds.
35 -# The job is not deleted if check fails.
36 -# Attempts to start the job are made once every autodetection_retry.
37 -# This feature is disabled by default.
38 -# autodetection_retry: 0
39 -
40 -# ----------------------------------------------------------------------
41 -# JOBS (data collection sources)
42 -#
43 -# The default JOBS share the same *name*. JOBS with the same name
44 -# are mutually exclusive. Only one of them will be allowed running at
45 -# any time. This allows autodetection to try several alternatives and
46 -# pick the one that works.
47 -#
48 -# Any number of jobs is supported.
49 -#
50 -# All python.d.plugin JOBS (for all its modules) support a set of
51 -# predefined parameters. These are:
52 -#
53 -# job_name:
54 -# name: myname # the JOB's name as it will appear at the
55 -# # dashboard (by default is the job_name)
56 -# # JOBs sharing a name are mutually exclusive
57 -# update_every: 1 # the JOB's data collection frequency
58 -# priority: 60000 # the JOB's order on the dashboard
59 -# penalty: yes # the JOB's penalty
60 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
61 -#
62 -# Additionally to the above, fail2ban also supports the following:
63 -#
64 -# log_path: 'path to fail2ban.log' # Default: '/var/log/fail2ban.log'
65 -# conf_path: 'path to jail.local/jail.conf' # Default: '/etc/fail2ban/jail.local'
66 -# conf_dir: 'path to jail.d/' # Default: '/etc/fail2ban/jail.d/'
67 -# exclude: 'jails you want to exclude from autodetection' # Default: none
68 -#------------------------------------------------------------------------------------------------------------------
src/collectors/python.d.plugin/fail2ban/integrations/fail2ban.md deleted
-209
@@ -1,209 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/fail2ban/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/fail2ban/metadata.yaml"
4 -sidebar_label: "Fail2ban"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/Authentication and Authorization"
7 -most_popular: False
8 -message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9 -endmeta-->
10 -
11 -# Fail2ban
12 -
13 -
14 -<img src="https://netdata.cloud/img/fail2ban.png" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: fail2ban
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -Monitor Fail2ban performance for prime intrusion prevention operations. Monitor ban counts, jail statuses, and failed login attempts to ensure robust network security.
25 -
26 -
27 -It collects metrics through reading the default log and configuration files of fail2ban.
28 -
29 -
30 -This collector is supported on all platforms.
31 -
32 -This collector supports collecting metrics from multiple instances of this integration, including remote instances.
33 -
34 -The `fail2ban.log` file must be readable by the user `netdata`.
35 - - change the file ownership and access permissions.
36 - - update `/etc/logrotate.d/fail2ban`` to persist the changes after rotating the log file.
37 -
38 -To change the file ownership and access permissions, execute the following:
39 -
40 -```shell
41 -sudo chown root:netdata /var/log/fail2ban.log
42 -sudo chmod 640 /var/log/fail2ban.log
43 -```
44 -
45 -To persist the changes after rotating the log file, add `create 640 root netdata` to the `/etc/logrotate.d/fail2ban`:
46 -
47 -```shell
48 -/var/log/fail2ban.log {
49 -
50 - weekly
51 - rotate 4
52 - compress
53 -
54 - delaycompress
55 - missingok
56 - postrotate
57 - fail2ban-client flushlogs 1>/dev/null
58 - endscript
59 -
60 - # If fail2ban runs as non-root it still needs to have write access
61 - # to logfiles.
62 - # create 640 fail2ban adm
63 - create 640 root netdata
64 -}
65 -```
66 -
67 -
68 -### Default Behavior
69 -
70 -#### Auto-Detection
71 -
72 -By default the collector will attempt to read log file at /var/log/fail2ban.log and conf file at /etc/fail2ban/jail.local.
73 -If conf file is not found default jail is ssh.
74 -
75 -
76 -#### Limits
77 -
78 -The default configuration for this integration does not impose any limits on data collection.
79 -
80 -#### Performance Impact
81 -
82 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
83 -
84 -
85 -## Metrics
86 -
87 -Metrics grouped by *scope*.
88 -
89 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
90 -
91 -
92 -
93 -### Per Fail2ban instance
94 -
95 -These metrics refer to the entire monitored application.
96 -
97 -
98 -This scope has no labels.
99 -
100 -Metrics:
101 -
102 -| Metric | Dimensions | Unit |
103 -|:------|:----------|:----|
104 -| fail2ban.failed_attempts | a dimension per jail | attempts/s |
105 -| fail2ban.bans | a dimension per jail | bans/s |
106 -| fail2ban.banned_ips | a dimension per jail | ips |
107 -
108 -
109 -
110 -## Alerts
111 -
112 -There are no alerts configured by default for this integration.
113 -
114 -
115 -## Setup
116 -
117 -### Prerequisites
118 -
119 -No action required.
120 -
121 -### Configuration
122 -
123 -#### File
124 -
125 -The configuration file name for this integration is `python.d/fail2ban.conf`.
126 -
127 -
128 -You can edit the configuration file using the `edit-config` script from the
129 -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md#the-netdata-config-directory).
130 -
131 -```bash
132 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
133 -sudo ./edit-config python.d/fail2ban.conf
134 -```
135 -#### Options
136 -
137 -There are 2 sections:
138 -
139 -* Global variables
140 -* One or more JOBS that can define multiple different instances to monitor.
141 -
142 -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.
143 -
144 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
145 -
146 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
147 -
148 -
149 -<details><summary>Config options</summary>
150 -
151 -| Name | Description | Default | Required |
152 -|:----|:-----------|:-------|:--------:|
153 -| log_path | path to fail2ban.log. | /var/log/fail2ban.log | no |
154 -| conf_path | path to jail.local/jail.conf. | /etc/fail2ban/jail.local | no |
155 -| conf_dir | path to jail.d/. | /etc/fail2ban/jail.d/ | no |
156 -| exclude | jails you want to exclude from autodetection. | | no |
157 -| update_every | Sets the default data collection frequency. | 1 | no |
158 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
159 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
160 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
161 -| name | 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. | | no |
162 -
163 -</details>
164 -
165 -#### Examples
166 -
167 -##### Basic
168 -
169 -A basic example configuration.
170 -
171 -```yaml
172 -local:
173 - log_path: '/var/log/fail2ban.log'
174 - conf_path: '/etc/fail2ban/jail.local'
175 -
176 -```
177 -
178 -
179 -## Troubleshooting
180 -
181 -### Debug Mode
182 -
183 -To troubleshoot issues with the `fail2ban` collector, run the `python.d.plugin` with the debug option enabled. The output
184 -should give you clues as to why the collector isn't working.
185 -
186 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
187 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
188 -
189 - ```bash
190 - cd /usr/libexec/netdata/plugins.d/
191 - ```
192 -
193 -- Switch to the `netdata` user.
194 -
195 - ```bash
196 - sudo -u netdata -s
197 - ```
198 -
199 -- Run the `python.d.plugin` to debug the collector:
200 -
201 - ```bash
202 - ./python.d.plugin fail2ban debug trace
203 - ```
204 -
205 -### Debug Mode
206 -
207 -
208 -
209 -
src/collectors/python.d.plugin/fail2ban/metadata.yaml deleted
-200
@@ -1,200 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: fail2ban
6 - monitored_instance:
7 - name: Fail2ban
8 - link: https://www.fail2ban.org/
9 - categories:
10 - - data-collection.authentication-and-authorization
11 - icon_filename: "fail2ban.png"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - fail2ban
19 - - security
20 - - authentication
21 - - authorization
22 - most_popular: false
23 - overview:
24 - data_collection:
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:
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:
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.
71 - If conf file is not found default jail is ssh.
72 - limits:
73 - description: ""
74 - performance_impact:
75 - description: ""
76 - setup:
77 - prerequisites:
78 - list: []
79 - configuration:
80 - file:
81 - name: python.d/fail2ban.conf
82 - description: ""
83 - options:
84 - description: |
85 - There are 2 sections:
86 -
87 - * Global variables
88 - * One or more JOBS that can define multiple different instances to monitor.
89 -
90 - 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.
91 -
92 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
93 -
94 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
95 - folding:
96 - title: Config options
97 - enabled: true
98 - list:
99 - - name: log_path
100 - description: path to fail2ban.log.
101 - default_value: /var/log/fail2ban.log
102 - required: false
103 - - name: conf_path
104 - description: path to jail.local/jail.conf.
105 - default_value: /etc/fail2ban/jail.local
106 - required: false
107 - - name: conf_dir
108 - description: path to jail.d/.
109 - default_value: /etc/fail2ban/jail.d/
110 - required: false
111 - - name: exclude
112 - description: jails you want to exclude from autodetection.
113 - default_value: ""
114 - required: false
115 - - name: update_every
116 - description: Sets the default data collection frequency.
117 - default_value: 1
118 - required: false
119 - - name: priority
120 - description: Controls the order of charts at the netdata dashboard.
121 - default_value: 60000
122 - required: false
123 - - name: autodetection_retry
124 - description: Sets the job re-check interval in seconds.
125 - default_value: 0
126 - required: false
127 - - name: penalty
128 - description: Indicates whether to apply penalty to update_every in case of failures.
129 - default_value: yes
130 - required: false
131 - - name: name
132 - 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.
133 - default_value: ""
134 - required: false
135 - examples:
136 - folding:
137 - enabled: true
138 - title: Config
139 - list:
140 - - name: Basic
141 - folding:
142 - enabled: false
143 - description: A basic example configuration.
144 - config: |
145 - local:
146 - log_path: '/var/log/fail2ban.log'
147 - conf_path: '/etc/fail2ban/jail.local'
148 - troubleshooting:
149 - problems:
150 - list:
151 - - name: Debug Mode
152 - description: |
153 - To troubleshoot issues with the `fail2ban` module, run the `python.d.plugin` with the debug option enabled.
154 - The output will give you the output of the data collection job or error messages on why the collector isn't working.
155 -
156 - First, navigate to your plugins directory, usually they are located under `/usr/libexec/netdata/plugins.d/`. If that's
157 - not the case on your system, open `netdata.conf` and look for the setting `plugins directory`. Once you're in the
158 - plugin's directory, switch to the `netdata` user.
159 -
160 - ```bash
161 - cd /usr/libexec/netdata/plugins.d/
162 - sudo su -s /bin/bash netdata
163 - ```
164 -
165 - Now you can manually run the `fail2ban` module in debug mode:
166 -
167 - ```bash
168 - ./python.d.plugin fail2ban debug trace
169 - ```
170 - alerts: []
171 - metrics:
172 - folding:
173 - title: Metrics
174 - enabled: false
175 - description: ""
176 - availability: []
177 - scopes:
178 - - name: global
179 - description: |
180 - These metrics refer to the entire monitored application.
181 - labels: []
182 - metrics:
183 - - name: fail2ban.failed_attempts
184 - description: Failed attempts
185 - unit: "attempts/s"
186 - chart_type: line
187 - dimensions:
188 - - name: a dimension per jail
189 - - name: fail2ban.bans
190 - description: Bans
191 - unit: "bans/s"
192 - chart_type: line
193 - dimensions:
194 - - name: a dimension per jail
195 - - name: fail2ban.banned_ips
196 - description: Banned IP addresses (since the last restart of netdata)
197 - unit: "ips"
198 - chart_type: line
199 - dimensions:
200 - - name: a dimension per jail
src/collectors/python.d.plugin/python.d.conf
+3 -3
@@ -39,12 +39,12 @@ gc_interval: 300
39 example: no
40
41 # exim: yes
42 -# fail2ban: yes
42 +fail2ban: no # Removed (replaced with go.d/fail2ban). Disabled for existing installations.
43 # gearman: yes
44 go_expvar: no
45
46 # haproxy: yes
47 -hddtemp: no # replaced with go.d/hddtemp. Disabled for existing installations.
47 +hddtemp: no # Removed (replaced with go.d/hddtemp). Disabled for existing installations.
48 hpssa: no
49 # icecast: yes
50 # ipfs: yes
@@ -63,7 +63,7 @@ hpssa: no
63 # retroshare: yes
64 # riakkv: yes
65 # samba: yes
66 -sensors: no # replaced with go.d/sensors. Disabled for existing installations.
66 +sensors: no # Removed (replaced with go.d/sensors). Disabled for existing installations.
67 # smartd_log: yes
68 # spigotmc: yes
69 # squid: yes