Commit Graph

5 Commits

Author SHA1 Message Date
Hector
526b1c7272 fix: update banned metrics to exclude expired bans
Update the database query counting the number of banned IPs to filter out
any bans that have already expired. An expired ban is defined as a ban
where the "time of ban" plus the "duration of ban" is less than the
current time.
This is necessary because bans that have expired are not automatically
removed from the database and will cause metrics to diverge from the counts
reported by `fail2ban-client`.
2021-08-27 16:29:01 +01:00
Hector
8726afcd6b feat: new metric to track error counts
Add a new metric to count the number of database errors that have been
found since startup. This complements the `up` metric to have better
visibility into occasional database errors.
2021-04-07 21:46:41 +01:00
Hector
bd841c3a35 feat: set up metric to 0 if errors found
The `up` metric is now based on whether an error was found while reading
data from the database to build other metrics. Note that there is a chance
the `up` metric will not be correctly set if the last metric to be built
before the `up` metric does not throw an error.
2021-04-07 21:32:49 +01:00
Hector
1282d635eb feat: new metric for enabled jails (#1)
Add a new prometheus metric to track which jails are currently enabled.
Add a new database query to read the jail name and enabled status from the
database.
Add new metric to readme file.
2021-04-07 18:55:34 +01:00
Hector
9bf3195743 chore: move all source files to new folder
Update the project structure to move all golang files to a new `src/`
folder. This keeps all the code located in the same place and easier to
work with.
Update the Makefile and goreleaser config to continue to work with the new
folder structure.
2021-02-08 18:49:48 +00:00