Added key unraid.temperatures to get system temperatures. Note that this only works if you have the Dynamix System Temperature plugin installed.
This commit is contained in:
parent
a13fe545a1
commit
1b97010de8
@ -27,3 +27,4 @@ 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
|
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
result=$( sensors )
|
||||
error="$?"
|
||||
if [ "$error" -gt 0 ]; then
|
||||
echo '{"error": "sensors is not installed"}'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "{"
|
||||
|
||||
# CPU temp
|
||||
line=$( grep 'CPU Temp:' <<< "$result" )
|
||||
error="$?"
|
||||
echo -n '"cpu": '
|
||||
if [ "$error" -eq 0 ]; then
|
||||
read _ _ temp _ <<< "$line"
|
||||
temp="${temp#+}"
|
||||
temp="${temp%°C}"
|
||||
echo -n "$temp"
|
||||
else
|
||||
echo -n "null"
|
||||
fi
|
||||
|
||||
# MB
|
||||
line=$(grep 'MB Temp:' <<< "$result" )
|
||||
error="$?"
|
||||
echo -n ', "mainboard": '
|
||||
if [ "$error" -eq 0 ]; then
|
||||
read _ _ temp _ <<< "$line"
|
||||
temp="${temp#+}"
|
||||
temp="${temp%°C}"
|
||||
echo -n "$temp"
|
||||
else
|
||||
echo -n "null"
|
||||
fi
|
||||
|
||||
echo "}"
|
Loading…
Reference in New Issue
Block a user