]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
zabbix_agentd: Fix ipfire.net.gateway.ping
authorRobin Roevens <robin.roevens@disroot.org>
Fri, 27 Oct 2023 19:49:01 +0000 (21:49 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Oct 2023 10:04:03 +0000 (10:04 +0000)
Fixes custom IPFire Zabbix Agent userparameter ipfire.net.gateway.ping
returning 1 (success) when fping failed for other reasons (rc 2,3 or 4)
than host unreachable (rc 0).

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/zabbix_agentd/userparameter_ipfire.conf

index b8b512d820356a59a37d7805661d527d87955716..ba0c6c2ca3538307c12475260c3662830184ff03 100644 (file)
@@ -3,7 +3,7 @@
 # Internet Gateway ping timings, can be used to measure "Internet Line Quality"
 UserParameter=ipfire.net.gateway.pingtime,sudo /usr/sbin/fping -c 3 gateway 2>&1 | tail -n 1 | awk '{print $NF}' | cut -d '/' -f2
 # Internet Gateway availability, can be used to check Internet connection
-UserParameter=ipfire.net.gateway.ping,sudo /usr/sbin/fping -q -r 3 gateway; [ ! $? ]; echo $?
+UserParameter=ipfire.net.gateway.ping,sudo /usr/sbin/fping -q -r 3 gateway; [ ! $? == 0 ]; echo $?
 # Firewall Filter Forward chain drops in bytes/chain (JSON), can be used for discovery of firewall chains and monitoring of firewall hits on each chain
 UserParameter=ipfire.net.fw.hits.raw,sudo /usr/local/bin/getipstat -xf | grep "/\* DROP_.* \*/$" | awk 'BEGIN { ORS = ""; print "["} { printf "%s{\"chain\": \"%s\", \"bytes\": \"%s\"}", separator, substr($11, 6), $2; separator = ", "; } END { print"]" }'
 # Number of currently Active DHCP leases