Re: Change SNMP data
Posted: Fri Mar 04, 2016 10:49 am
Im not 100% sure how to do that, I will have to do some research and figure out how to write the script.
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
#!/bin/bash
output=$(/usr/local/nagios/libexec/check_snmp -H 10.2.50.251 -o 1.3.6.1.4.1.318.1.1.1.2.3.4.0 -C snmpstring -P 1 -l "Battery Actual Voltage" -u "V DC" -m powernet417.mib -w @682.5:882.5 -c @0:682.5)
exit=$?
if [ "$exit" == 0 ]
then
output2=$(echo "$output" | sed "s/./\.&/45")
output3=$(echo "$output2" | sed "s/./\.&/83")
echo "$output3"
exit 0
elif [ "$exit" == 1 ]
then
echo "$output"
exit 1
elif [ "$exit" == 2 ]
then
echo "$output"
exit 2
elif [ "$exit" == 3 ]
then
echo "$output"
exit 3
fi