Page 1 of 1

snmpwalk v3 error in nagios for router snmp parameters

Posted: Sat Aug 17, 2013 2:08 pm
by barry1946
i m using nagios for monitoring routers installed on a centos 6.4
i want to snmpwalk (v3) the router and I receive some error:

No log handling enabled - turning on stderr logging
snmpwalk: USM generic error


it seems to be something with the mib as I searched the net but i have no info about it
is there anyone who can find a solution for this?

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Mon Aug 19, 2013 11:07 am
by sreinhardt
What particular command are you running to do an snmpwalk? What device make and model are you trying to scan? Also let's do an nmap to be sure that snmp is open to the nagios machine.

Code: Select all

nmap -sU -p 161 [IP of switch\router]

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Mon Aug 19, 2013 11:08 am
by abrist
What was the full snmpwalk command you used? SNMP v3 Auth can be tricky.

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Wed Aug 28, 2013 5:07 am
by barry1946
thanks guys.
I got the MIB file with snmp v2 since it was easier,
but it did not gave me a string for the ports to monitor the status of them.
i studied the manual in this link http://nagios.sourceforge.net/docs/nagi ... uters.html
which says to use this config :

define service{

use generic-service ; Inherit values from a template

host_name linksys-srw224p

service_description Port 1 Link Status

check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB

}

In the example above, the "-o ifOperStatus.1" refers to the OID for the operational status of port 1 on the switch.
but my collected info is like this :
IF-MIB::ifOperStatus.1030 = INTEGER: down(2)
IF-MIB::ifOperStatus.1158 = INTEGER: down(2)
IF-MIB::ifOperStatus.1286 = INTEGER: down(2)
IF-MIB::ifOperStatus.1409 = INTEGER: up(1)
IF-MIB::ifOperStatus.1537 = INTEGER: up(1)
IF-MIB::ifOperStatus.1666 = INTEGER: down(2)
IF-MIB::ifOperStatus.1794 = INTEGER: down(2)
IF-MIB::ifOperStatus.1922 = INTEGER: down(2)
IF-MIB::ifOperStatus.2050 = INTEGER: down(2)
IF-MIB::ifOperStatus.2178 = INTEGER: down(2)
IF-MIB::ifOperStatus.2306 = INTEGER: down(2)
IF-MIB::ifOperStatus.2434 = INTEGER: down(2)
IF-MIB::ifOperStatus.2562 = INTEGER: down(2)
and there is nothing as a string in it.
so how am i suppose to get the OID from?

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Wed Aug 28, 2013 9:45 am
by abrist
barry1946 wrote:and there is nothing as a string in it.
The string to check would be the end of the return: up(1) or down(2)
Additionally, you could just check the integer instead of the string. I am unsure why your device is listing the port IDs in the thousands. You may want to contact the vendor for clarification.

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Fri Aug 30, 2013 10:38 am
by barry1946
this is a Huawei router which returns the value like this.
i found a page on the internet which tells to use this OID :
!.1.3.6.1.2.1.2.2.1.8.X!-r 1!-l ifOperStatus

replacing the X at the end with the thousand values!!!
but I need to achieve the OIDs for whatever I want , do you know a way for this?

Re: snmpwalk v3 error in nagios for router snmp parameters

Posted: Fri Aug 30, 2013 10:53 am
by sreinhardt
Let's start by going back to your snmpwalk and get the identifier for each port:

Code: Select all

snmpwalk -c public -v 2v linksys-srw224p .1.3.6.1.2.1.2.2.1.8