zabbix_agentd: Make kresd userparameter not ipfire specific

Message ID 20260730214502.613317-2-robin.roevens@disroot.org
State New
Headers
Series zabbix_agentd: Make kresd userparameter not ipfire specific |

Commit Message

Robin Roevens 30 Jul 2026, 9:40 p.m. UTC
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
  

Patch

diff --git a/config/rootfiles/packages/zabbix_agentd b/config/rootfiles/packages/zabbix_agentd
index 7f1f39b64..9d928974f 100644
--- a/config/rootfiles/packages/zabbix_agentd
+++ b/config/rootfiles/packages/zabbix_agentd
@@ -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
diff --git a/config/zabbix_agentd/userparameter_ipfire.conf b/config/zabbix_agentd/userparameter_ipfire.conf
index a91e305a3..e88c20298 100644
--- a/config/zabbix_agentd/userparameter_ipfire.conf
+++ b/config/zabbix_agentd/userparameter_ipfire.conf
@@ -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
diff --git a/config/zabbix_agentd/userparameter_kresd.conf b/config/zabbix_agentd/userparameter_kresd.conf
new file mode 100644
index 000000000..f5765919b
--- /dev/null
+++ b/config/zabbix_agentd/userparameter_kresd.conf
@@ -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
diff --git a/lfs/zabbix_agentd b/lfs/zabbix_agentd
index cbf4b246c..e41cd6fe1 100644
--- a/lfs/zabbix_agentd
+++ b/lfs/zabbix_agentd
@@ -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