flag all fields related to db-based metrics as deprecated
This commit is contained in:
parent
737a86b6fd
commit
76c9dd93f4
@ -22,7 +22,7 @@ func Parse() *AppSettings {
|
|||||||
appSettings := &AppSettings{}
|
appSettings := &AppSettings{}
|
||||||
flag.BoolVar(&appSettings.VersionMode, "version", false, "show version info and exit")
|
flag.BoolVar(&appSettings.VersionMode, "version", false, "show version info and exit")
|
||||||
flag.IntVar(&appSettings.MetricsPort, "port", 9191, "port to use for the metrics server")
|
flag.IntVar(&appSettings.MetricsPort, "port", 9191, "port to use for the metrics server")
|
||||||
flag.StringVar(&appSettings.Fail2BanDbPath, "db", "", "path to the fail2ban sqlite database")
|
flag.StringVar(&appSettings.Fail2BanDbPath, "db", "", "path to the fail2ban sqlite database (deprecated)")
|
||||||
flag.StringVar(&appSettings.Fail2BanSocketPath, "socket", "", "path to the fail2ban server socket")
|
flag.StringVar(&appSettings.Fail2BanSocketPath, "socket", "", "path to the fail2ban server socket")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -26,27 +26,27 @@ var (
|
|||||||
|
|
||||||
metricUp = prometheus.NewDesc(
|
metricUp = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "", "up"),
|
prometheus.BuildFQName(namespace, "", "up"),
|
||||||
"Was the last fail2ban query successful.",
|
"(Deprecated) Was the last fail2ban query successful.",
|
||||||
nil, nil,
|
nil, nil,
|
||||||
)
|
)
|
||||||
metricBannedIpsPerJail = prometheus.NewDesc(
|
metricBannedIpsPerJail = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "", "banned_ips"),
|
prometheus.BuildFQName(namespace, "", "banned_ips"),
|
||||||
"Number of banned IPs stored in the database (per jail).",
|
"(Deprecated) Number of banned IPs stored in the database (per jail).",
|
||||||
[]string{"jail"}, nil,
|
[]string{"jail"}, nil,
|
||||||
)
|
)
|
||||||
metricBadIpsPerJail = prometheus.NewDesc(
|
metricBadIpsPerJail = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "", "bad_ips"),
|
prometheus.BuildFQName(namespace, "", "bad_ips"),
|
||||||
"Number of bad IPs stored in the database (per jail).",
|
"(Deprecated) Number of bad IPs stored in the database (per jail).",
|
||||||
[]string{"jail"}, nil,
|
[]string{"jail"}, nil,
|
||||||
)
|
)
|
||||||
metricEnabledJails = prometheus.NewDesc(
|
metricEnabledJails = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "", "enabled_jails"),
|
prometheus.BuildFQName(namespace, "", "enabled_jails"),
|
||||||
"Enabled jails.",
|
"(Deprecated) Enabled jails.",
|
||||||
[]string{"jail"}, nil,
|
[]string{"jail"}, nil,
|
||||||
)
|
)
|
||||||
metricErrorCount = prometheus.NewDesc(
|
metricErrorCount = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(namespace, "", "errors"),
|
prometheus.BuildFQName(namespace, "", "errors"),
|
||||||
"Number of errors found since startup.",
|
"(Deprecated) Number of errors found since startup.",
|
||||||
[]string{"type"}, nil,
|
[]string{"type"}, nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -287,6 +287,7 @@ func main() {
|
|||||||
|
|
||||||
exporter := &Exporter{}
|
exporter := &Exporter{}
|
||||||
if appSettings.Fail2BanDbPath != "" {
|
if appSettings.Fail2BanDbPath != "" {
|
||||||
|
log.Print("database-based metrics have been deprecated and will be removed in a future release")
|
||||||
exporter.db = fail2banDb.MustConnectToDb(appSettings.Fail2BanDbPath)
|
exporter.db = fail2banDb.MustConnectToDb(appSettings.Fail2BanDbPath)
|
||||||
}
|
}
|
||||||
if appSettings.Fail2BanSocketPath != "" {
|
if appSettings.Fail2BanSocketPath != "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user