Added an endpoint for UPS stats.
This commit is contained in:
@ -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
|
||||
UserParameter=unraid.temperatures,/usr/local/emhttp/plugins/zabbix_agent/scripts/temperatures.sh
|
||||
UserParameter=unraid.ups,/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh
|
||||
|
15
files/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh
Executable file
15
files/usr/local/emhttp/plugins/zabbix_agent/scripts/ups.sh
Executable file
@ -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 "}"
|
Reference in New Issue
Block a user