'snmp_sensors.sh' hinzufügen

This commit is contained in:
2022-01-12 08:29:23 +01:00
parent d160517342
commit 5e96a54fd3

15
snmp_sensors.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [ -z $1 ] ; then
echo "No Paramters given."
exit 1
fi
if [ "z${1}" == "zcpu" ] ; then
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo $((cpu/1000))
exit 0
elif [ "z${1}" == "zgpu" ] ; then
gpu=$(/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f 2 | cut -d "'" -f 1)
echo $gpu
exit 0
fi