diff --git a/files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf b/files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf index db2893a..ef73b79 100644 --- a/files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf +++ b/files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf @@ -27,4 +27,5 @@ UserParameter=unraid.disk[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/disk UserParameter=unraid.disks.totals,/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.totals.sh UserParameter=unraid.qemu.discovery,/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.discovery.sh UserParameter=unraid.qemu[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh "$1" -UserParameter=unraid.temperatures,/usr/local/emhttp/plugins/zabbix_agent/scripts/temperatures.sh \ No newline at end of file +UserParameter=unraid.temperatures,/usr/local/emhttp/plugins/zabbix_agent/scripts/temperatures.sh +UserParameter=unraid.ups,/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh diff --git a/files/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh new file mode 100755 index 0000000..cfb6825 --- /dev/null +++ b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo -n '{"connected":true' +apcaccess | while read key _ value unit _; do + #echo $key - $value - $unit + case "$key" in + "STATUS") echo -n ", \"status\":\"$value\"" ;; + "LOADPCT") echo -n ", \"loadpct\":$value" ;; + "BCHARGE") echo -n ", \"bcharge\":$value" ;; + "TIMELEFT") echo -n ", \"timeleft\":$value" ;; + "BATTV") echo -n ", \"battv\":$value" ;; + "LINEV") echo -n ", \"linev\":$value" ;; + esac +done +echo "}" diff --git a/zabbix_agent.plg b/zabbix_agent.plg index 9296321..5187731 100644 --- a/zabbix_agent.plg +++ b/zabbix_agent.plg @@ -20,6 +20,7 @@ ### &version; - Updated zabbix_agentd from 5.0.2 to 5.0.3 - Download updated plugins from stable instead of main. +- Added new zabbix endpoint unraid.ups ### 2020.09.05.1 - Added a new field 'running' to qemu.disk