Hello,
I am having a problem configuring snmp to monitor a UPS. The monitoring works, but it displays data improperly. For example, SNMP OK - Input Voltage 1227 Volts should be 122.7 Volts.
Is there any way to fix this?
Change SNMP data
Re: Change SNMP data
If you check it from the command line, is the value correct?
Former Nagios Employee.
me.
me.
Re: Change SNMP data
hsmith wrote:If you check it from the command line, is the value correct?
No it is returning 1225
Re: Change SNMP data
So you're fetching it w/ snmpget? I'd look into adding the decimal, or lopping off the last digit and verifying the value is greater than 2 digits, 100 or greater. Nagios receives what is sent or pulled from the SNMP system, it doesn't change the data.
More info's needed on what script, language, etc. is pulling the data.
More info's needed on what script, language, etc. is pulling the data.
Re: Change SNMP data
Thanks @gormank!
As @gormank mentioned - please post the script that you're using to check.
As @gormank mentioned - please post the script that you're using to check.
Former Nagios Employee
Re: Change SNMP data
I am using nagios xi currently under an evaluation license. The command that I am using is check_xi_service_snmp.
Here is the test output.
COMMAND: /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
OUTPUT: SNMP OK - Battery Actual Voltage 1364 V DC | 'Battery Actual Voltage'=1364V DC;882;682;
Here is the test output.
COMMAND: /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
OUTPUT: SNMP OK - Battery Actual Voltage 1364 V DC | 'Battery Actual Voltage'=1364V DC;882;682;
Re: Change SNMP data
I think that the best way to approach this likely involves a simple wrapper script. You'll have to make your own script and implement it as a new plugin in XI - example:
I wrote this script quickly, so it's likely riddled with things that could be improved - but hopefully it serves the purpose of demonstration. If you can modify the standard output, you can modify how Nagios interprets the results.
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
fiRe: Change SNMP data
Do you want to check the input voltage to your UPS or the battery voltage, or both?
What OID are you using to monitor the input voltage?
Can you run the following and post the output?
Can you upload the MIB file so we can review it?
What OID are you using to monitor the input voltage?
Can you run the following and post the output?
Code: Select all
/usr/local/nagios/libexec/check_snmp -H 10.2.50.251 -o 1.3.6.1.4.1.318.1.1.1.3.3.1.0 -C snmpstring -P 1 -m powernet417.mibBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Change SNMP data
Do you want to check the input voltage to your UPS or the battery voltage, or both?
Both
What OID are you using to monitor the input voltage?
1.3.6.1.4.1.318.1.1.1.3.3.1.0
Can you run the following and post the output?
SNMP OK - 1237 | iso 3.6.1.4.1.318.1.1.1.3.3.1.0=1237
https://dl.dropboxusercontent.com/u/944 ... net417.mib
Both
What OID are you using to monitor the input voltage?
1.3.6.1.4.1.318.1.1.1.3.3.1.0
Can you run the following and post the output?
SNMP OK - 1237 | iso 3.6.1.4.1.318.1.1.1.3.3.1.0=1237
https://dl.dropboxusercontent.com/u/944 ... net417.mib