metadata.yaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. To change the file ownership and access permissions, execute the following:
  39. ```shell
  40. sudo chown root:netdata /var/log/fail2ban.log
  41. sudo chmod 640 /var/log/fail2ban.log
  42. ```
  43. To persist the changes after rotating the log file, add `create 640 root netdata` to the `/etc/logrotate.d/fail2ban`:
  44. ```shell
  45. /var/log/fail2ban.log {
  46. weekly
  47. rotate 4
  48. compress
  49. delaycompress
  50. missingok
  51. postrotate
  52. fail2ban-client flushlogs 1>/dev/null
  53. endscript
  54. # If fail2ban runs as non-root it still needs to have write access
  55. # to logfiles.
  56. # create 640 fail2ban adm
  57. create 640 root netdata
  58. }
  59. ```
  60. default_behavior:
  61. auto_detection:
  62. description: |
  63. By default the collector will attempt to read log file at /var/log/fail2ban.log and conf file at /etc/fail2ban/jail.local.
  64. If conf file is not found default jail is ssh.
  65. limits:
  66. description: ""
  67. performance_impact:
  68. description: ""
  69. setup:
  70. prerequisites:
  71. list: []
  72. configuration:
  73. file:
  74. name: python.d/fail2ban.conf
  75. description: ""
  76. options:
  77. description: |
  78. There are 2 sections:
  79. * Global variables
  80. * One or more JOBS that can define multiple different instances to monitor.
  81. 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.
  82. Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
  83. Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
  84. folding:
  85. title: Config options
  86. enabled: true
  87. list:
  88. - name: log_path
  89. description: path to fail2ban.log.
  90. default_value: /var/log/fail2ban.log
  91. required: false
  92. - name: conf_path
  93. description: path to jail.local/jail.conf.
  94. default_value: /etc/fail2ban/jail.local
  95. required: false
  96. - name: conf_dir
  97. description: path to jail.d/.
  98. default_value: /etc/fail2ban/jail.d/
  99. required: false
  100. - name: exclude
  101. description: jails you want to exclude from autodetection.
  102. default_value: ""
  103. required: false
  104. - name: update_every
  105. description: Sets the default data collection frequency.
  106. default_value: 1
  107. required: false
  108. - name: priority
  109. description: Controls the order of charts at the netdata dashboard.
  110. default_value: 60000
  111. required: false
  112. - name: autodetection_retry
  113. description: Sets the job re-check interval in seconds.
  114. default_value: 0
  115. required: false
  116. - name: penalty
  117. description: Indicates whether to apply penalty to update_every in case of failures.
  118. default_value: yes
  119. required: false
  120. - name: name
  121. 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.
  122. default_value: ""
  123. required: false
  124. examples:
  125. folding:
  126. enabled: true
  127. title: Config
  128. list:
  129. - name: Basic
  130. folding:
  131. enabled: false
  132. description: A basic example configuration.
  133. config: |
  134. local:
  135. log_path: '/var/log/fail2ban.log'
  136. conf_path: '/etc/fail2ban/jail.local'
  137. troubleshooting:
  138. problems:
  139. list:
  140. - name: Debug Mode
  141. description: |
  142. To troubleshoot issues with the `fail2ban` module, run the `python.d.plugin` with the debug option enabled.
  143. The output will give you the output of the data collection job or error messages on why the collector isn't working.
  144. First, navigate to your plugins directory, usually they are located under `/usr/libexec/netdata/plugins.d/`. If that's
  145. not the case on your system, open `netdata.conf` and look for the setting `plugins directory`. Once you're in the
  146. plugin's directory, switch to the `netdata` user.
  147. ```bash
  148. cd /usr/libexec/netdata/plugins.d/
  149. sudo su -s /bin/bash netdata
  150. ```
  151. Now you can manually run the `fail2ban` module in debug mode:
  152. ```bash
  153. ./python.d.plugin fail2ban debug trace
  154. ```
  155. alerts: []
  156. metrics:
  157. folding:
  158. title: Metrics
  159. enabled: false
  160. description: ""
  161. availability: []
  162. scopes:
  163. - name: global
  164. description: |
  165. These metrics refer to the entire monitored application.
  166. labels: []
  167. metrics:
  168. - name: fail2ban.failed_attempts
  169. description: Failed attempts
  170. unit: "attempts/s"
  171. chart_type: line
  172. dimensions:
  173. - name: a dimension per jail
  174. - name: fail2ban.bans
  175. description: Bans
  176. unit: "bans/s"
  177. chart_type: line
  178. dimensions:
  179. - name: a dimension per jail
  180. - name: fail2ban.banned_ips
  181. description: Banned IP addresses (since the last restart of netdata)
  182. unit: "ips"
  183. chart_type: line
  184. dimensions:
  185. - name: a dimension per jail