Added an endpoint for UPS stats.

This commit is contained in:
Fabian Schlenz 2020-10-31 11:57:54 +01:00
parent 864d4385c3
commit 3de70efa44
3 changed files with 18 additions and 1 deletions

View File

@ -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

View 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 "}"

View File

@ -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