feat: export metrics for failed/banned counts

Add new metric to track the total number of jails configured in fail2ban.
Add new metrics for the current and total number of filter failures for
each jail, as well as the current/total number of banned IPs per jail.
The new metrics are collected by sending the `status [jail]` command to the
fail2ban server and parsing the response data.
This commit is contained in:
Hector
2021-08-29 16:54:20 +00:00
parent 617d711ecf
commit 1964dde273
3 changed files with 160 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import (
const (
commandTerminator = "<F2B_END_COMMAND>"
pingCommand = "ping"
statusCommand = "status"
socketReadBufferSize = 1024
)