socram
public text v1 · immutablerunning the script in CLI shows: OK - Delay is 63
The problem is nagios web shows: OK - Delay is /
#!/bin/sh
#socram[at]conexion[dot]com[dot]py
# get CLI values $1=host $2=community $3=target
rtt1=`snmpwalk $1 -v 1 -c $2 .1.3.6.1.4.1.9.9.42.1.5.2.1.1.$3 | cut -d " " -f4`
rtt2=`snmpwalk $1 -v 1 -c $2 .1.3.6.1.4.1.9.9.42.1.5.2.1.2.$3 | cut -d " " -f4`
delay=`expr $rtt2 / $rtt1`
# Finally Inform Nagios of what we found...
echo "OK - Delay is $delay"
exit 0