Snmp status problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

Snmp status problem

Post by Shivaramakrishnan »

Hello
I am trying to migrate all of the hosts that is present on one of the nagios server to another.
The problem is snmp works fine on one but it gives the unknown status on the other.
Can any one help me out in this regard?


define service{
use generic-service
host_name x
service_description Port 142 Link Status
check_command check_snmp! -C abcdefghijkilmnop -P 2c -o IF-MIB::ifOperStatus.142 -r 1 -m IF-MIB
}

works and produces the right output on the current nagios server,but gives the unknown status on the migrated one (new server to which I am migrating all the host)
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

Re: Snmp status problem

Post by Shivaramakrishnan »

To add,
The migration run with no issues for one of the host,but is giving unknown status for the other hosts.

define service{
use generic-service
host_name x
service_description Port 142 Link Status
check_command check_snmp! -C abcdefghijkilmnop -P 2c -o IF-MIB::ifOperStatus.142 -r 1 -m IF-MIB
}

Is something needs to be configured on the remote hosts or something needs to be configured on nagios server (The server to which I am migrating all the host and where I am getting unknown stats)?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Snmp status problem

Post by jsmurphy »

I would probably begin diagnosing the problem by seeing if you can use the linux snmpwalk utility to reach the devices, if you can't then you can assume that there is probably a configuration issue on the switch/router/etc... usually either the ACL's are blocking the SNMP traffic or the community string isn't quite right.

Otherwise you can move on to testing with the script and assuming that still works then begin inspecting your configuration carefully for errors.
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

Re: Snmp status problem

Post by Shivaramakrishnan »

Thanks a lot for the reply.
Can you please let me know the syntax to use snmp walk?
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

Re: Snmp status problem

Post by Shivaramakrishnan »

Do we need to add the new nagios server on the remote devices with the snmp credentials?
Like for one of the remote devices

/usr/lib/nagios/plugins/check_snmp -H a.b.c.d -C abcdefghijklmnop -P 2c -o sysUpTime.0
SNMP OK - Timeticks: (4015611708) 464 days, 18:28:37.08 | DISMAN-EVENT-MIB::sysUpTimeInstance=Timeticks: (4015611708) 464 days, 18:28:37.08



/usr/lib/nagios/plugins/check_snmp -H p.q.r.s -C abcdefghijklmnop -P 2c -o sysUpTime.0
SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 2c [authpriv] 74.217.36.2:161 sysUpTime.0

Can anyone help me out as soon as possible?
krw
Posts: 71
Joined: Tue May 29, 2012 2:01 pm

Re: Snmp status problem

Post by krw »

Shivaramakrishnan wrote:Do we need to add the new nagios server on the remote devices with the snmp credentials?
Like for one of the remote devices

/usr/lib/nagios/plugins/check_snmp -H a.b.c.d -C abcdefghijklmnop -P 2c -o sysUpTime.0
SNMP OK - Timeticks: (4015611708) 464 days, 18:28:37.08 | DISMAN-EVENT-MIB::sysUpTimeInstance=Timeticks: (4015611708) 464 days, 18:28:37.08



/usr/lib/nagios/plugins/check_snmp -H p.q.r.s -C abcdefghijklmnop -P 2c -o sysUpTime.0
SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 2c [authpriv] 74.217.36.2:161 sysUpTime.0

Can anyone help me out as soon as possible?
Umm...is snmp enabled on the new device? Sure you have the correct snmp password for a query?

snmpwalk -v2c -c password p.q.r.s > target.txt

will walk device using snmp and output it all to target.txt

How about a simple: snmpget -v2c -c password ipaddress sysUpTime.0
on the CLI of your nagios box?
Locked