snmp scripts

This commit is contained in:
Arne Baeumler 2015-12-14 22:17:43 +01:00
parent 782ea08f44
commit 0db0978c37
2 changed files with 24 additions and 0 deletions

16
monitor/getRSSI.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
COMMUNITY="public"
AGENT="192.168.0.1"
MACOID=".1.3.6.1.4.1.2021.255.3.54.1.3.32.1.4"
RSSIOID=".1.3.6.1.4.1.2021.255.3.54.1.3.32.1.26"
MAC=`echo $1 | sed 's/[:\.\-]//g' | sed 's/\(..\)/\1 /g'`
ID=`snmpwalk -On -v 2c -c $COMMUNITY $AGENT $MACOID | grep -i "$MAC" | awk '{print $1}' | sed 's/.*\([0123456789]\)$/\1/'`
if [ "x$ID" != "x" ];
then
snmpget -On -v 2c -c $COMMUNITY $AGENT "$RSSIOID.$ID" | awk '{print $4}'
else
echo "0"
fi

8
monitor/snmp-cpu-temp Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "-g" ]
then
echo .1.3.6.1.2.1.25.1.8
echo gauge
cat /sys/class/thermal/thermal_zone0/temp
fi
exit 0