zabbix_agentd: Make kresd userparameter not ipfire specific
Commit Message
By removing the "ipfire."-prefix from the userparameter, it allows
the Kresd monitoring Zabbix template to be more generic and
also usable on non-IPFire systems.
Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
---
config/rootfiles/packages/zabbix_agentd | 1 +
config/zabbix_agentd/userparameter_ipfire.conf | 3 ---
config/zabbix_agentd/userparameter_kresd.conf | 2 ++
lfs/zabbix_agentd | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
create mode 100644 config/zabbix_agentd/userparameter_kresd.conf
@@ -24,6 +24,7 @@ var/ipfire/zabbix_agentd/userparameters/userparameter_ovpn.conf
var/ipfire/zabbix_agentd/userparameters/userparameter_gateway.conf
var/ipfire/zabbix_agentd/userparameters/userparameter_wireguard.conf
var/ipfire/zabbix_agentd/userparameters/userparameter_locationdb.conf
+var/ipfire/zabbix_agentd/userparameters/userparameter_kresd.conf
var/ipfire/zabbix_agentd/scripts
var/ipfire/zabbix_agentd/scripts/ipfire_certificate_detail.sh
var/ipfire/zabbix_agentd/scripts/ipfire_services.pl
@@ -10,12 +10,9 @@ UserParameter=ipfire.captive.clients,awk -F ',' 'length($2) == 17 {sum += 1} END
UserParameter=ipfire.services.get,sudo /var/ipfire/zabbix_agentd/scripts/ipfire_services.pl
# IPS throughput bypassed/scanned/whitelisted in bytes/type (JSON)
UserParameter=ipfire.ips.throughput.get,sudo /usr/local/bin/getipstat -xm | awk 'BEGIN{ORS="";print "{"}/Chain IPS/{f=1}/BYPASSED/&&f{printf "\"bypassed\":%s",$2}/SCANNED/&&f{printf ",\"scanned\":%s",$2}/WHITELISTED/&&f{printf ",\"whitelisted\":%s",$2}/^$/{f=0}END{print "}"}'
-# Knot DNS resolver statistics
-UserParameter=ipfire.kresd.stats.get,sudo /usr/bin/curl -s --unix-socket /var/run/knot-resolver/kres-api.sock http://localhost/metrics/json
# Addon: Guardian: Number of currently blocked IP's
UserParameter=ipfire.guardian.blocked.count,sudo /usr/local/bin/getipstat | awk 'BEGIN{ORS="";c=0}/Chain GUARDIAN/{f=1}/DROP/&&f{c++}/^$/{f=0}END{print c}'
#
# Allow item key to be called with (unused) parameters. This allows the #SINGLETON method of discovering this item only when specific service is active
Alias=ipfire.ips.throughput.get[]:ipfire.ips.throughput.get
-Alias=ipfire.kresd.stats.get[]:ipfire.kresd.stats.get
Alias=ipfire.guardian.blocked.count[]:ipfire.guardian.blocked.count
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,2 @@
+# Knot DNS resolver statistics
+UserParameter=kresd.stats.get,sudo /usr/bin/curl -s --unix-socket /var/run/knot-resolver/kres-api.sock http://localhost/metrics/json
\ No newline at end of file
@@ -118,6 +118,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
/var/ipfire/zabbix_agentd/userparameters/userparameter_wireguard.conf
install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_locationdb.conf \
/var/ipfire/zabbix_agentd/userparameters/userparameter_locationdb.conf
+ install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_kresd.conf \
+ /var/ipfire/zabbix_agentd/userparameters/userparameter_kresd.conf
# Install IPFire-specific Zabbix Agent scripts
-mkdir -pv /var/ipfire/zabbix_agentd/scripts