Commit Graph

8 Commits

Author SHA1 Message Date
Hector
4f18bf35a8 feat: add cli parameters for db path and metrics port (#4)
Add support for configuring CLI parameters in the application using a new
`cfg` package. The `cfg` package exports an `AppSettings` struct that
contains the settings the application was run with.
Update the application to use the new CLI parameters to set the db to open
and the port to use for the metrics server.
Add support for setting the app version during build. The app includes a
`-version` flag to print the stored version data.
2021-02-06 15:17:35 +00:00
Hector
5e81a98162 Merge branch 'feat/export-metrics-from-fail2ban-db' into 'main'
Feat/export metrics from fail2ban db

See merge request hectorjsmith/fail2ban-prometheus-exporter!2
2021-02-06 12:29:47 +00:00
Hector
91cba8080c feat: export number of banned ips
Export the number of banned IPs stored in the fail2ban database as well
as the number of bad IPs.
Update the queries used to collect data to better handle cases where the
database table for bad/banned IPs is empty. The new query always lists all
jails, even when the count is zero.
2021-02-06 12:24:31 +00:00
Hector
4b965017d2 feat: export bad ip count per jail
Update exported metrics to spit the number of bad IPs per jail using metric
value labels. This includes a change to the database code to use a
different query that groups the count by the `jail` column.
2021-02-06 12:14:39 +00:00
Hector
0b40e5de82 feat: connect to fail2ban db and extract total bad ips
Add dependencies on `sqlite` to allow connecting to the fail2ban database.
Add a new `db` module to handle all the database connections and data
queries used to generate metrics.
Export a new metric for the total number of bad IPs stored in the fail2ban
database.
2021-02-06 11:50:13 +00:00
Hector
e2661bf243 Merge branch 'feat/basic-metric-exports' into 'main'
feat/basic-metric-exports

See merge request hectorjsmith/fail2ban-prometheus-exporter!1
2021-02-05 23:06:29 +00:00
Hector
7ced8464e0 feat: initial setup of metric exporter
Add dependency on the prometheus library to start exporting metrics. Add
a new `up` metric that always returns `1` to ensure the exporter is
working as expected.
2021-02-05 23:04:07 +00:00
Hector
5e52baa4cf initial commit 2021-02-05 22:49:47 +00:00