It my quick test I got a shell script to return an integer result of JUST the temp. Added that to my snmp.conf but as I walk the exec addins, it claims the value I am getting is a STRING (Note the 34 in the output), and I suspect RRDTool doesn't like it as it shows NaN for the values in my graph. Has anyone done this sort of thing to get an INTEGER result?
Code: Select all
gubbie /var/www # snmpwalk -Os -v 1 -c ellson localhost .1.3.6.1.4.1.2021.8
extIndex.1 = INTEGER: 1
extIndex.2 = INTEGER: 2
extNames.1 = STRING: echotest
extNames.2 = STRING: SysTemp
extCommand.1 = STRING: /bin/echo
extCommand.2 = STRING: /bin/sh
extResult.1 = INTEGER: 0
extResult.2 = INTEGER: 15
extOutput.1 = STRING: hello world
extOutput.2 = STRING: 34
extErrFix.1 = INTEGER: noError(0)
extErrFix.2 = INTEGER: noError(0)
extErrFixCmd.1 = STRING:
extErrFixCmd.2 = STRING:
gubbie /var/www # cat /tmp/temp.sh
#/bin/bash
typeset -i a=`/usr/local/bin/ipmitool sensor reading "System Temp" | cut -d"|" -f2 | tr -d [:blank:]`
echo $a
exit 15
snmp.conf:
exec SysTemp /bin/sh /tmp/temp.sh