Verified Commit a960e513 authored by Florian Pritz's avatar Florian Pritz
Browse files

zabbix-agent: Treat unset accounting values as 0



E.g. borg-backup.service has unset values when it is not running, but
zabbix doesn't know what to do with a string when it expects an integer
so fix those values here.
Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
parent b54f6b0c
......@@ -22,7 +22,7 @@ UserParameter=systemd.unit.is-enabled[*],systemctl is-enabled --quiet '$1' && ec
UserParameter=systemd.failed_units,/usr/local/bin/systemd-units-failed.py
UserParameter=systemd.accounting_discover,/usr/local/bin/systemd-discover-accounting-units.py
UserParameter=systemd.unit_data[*],systemctl show $(echo '$1' | sed 's#--AT--#@#g') | perl -MJSON -ne 'BEGIN{my %h}; my ($$k,$$v) = split(/=/,$$_,2); chomp($$h{$$k} = $v); END {print encode_json(\%h)};'
UserParameter=systemd.unit_data[*],systemctl show $(echo '$1' | sed 's#--AT--#@#g') | perl -MJSON -ne 'BEGIN{my %h}; my ($$k,$$v) = split(/=/,$$_,2); chomp($$h{$$k} = ($v =~ s/\[not set\]/0/r)); END {print encode_json(\%h)};'
UserParameter=borg_backup.data,/usr/local/bin/zabbix-borg-timestamps.pl
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment