Page 1 of 1
Snmp status problem
Posted: Thu May 31, 2012 6:28 pm
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)
Re: Snmp status problem
Posted: Thu May 31, 2012 6:55 pm
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)?
Re: Snmp status problem
Posted: Thu May 31, 2012 8:23 pm
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.
Re: Snmp status problem
Posted: Thu May 31, 2012 10:20 pm
by Shivaramakrishnan
Thanks a lot for the reply.
Can you please let me know the syntax to use snmp walk?
Re: Snmp status problem
Posted: Fri Jun 01, 2012 12:26 pm
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?
Re: Snmp status problem
Posted: Fri Jun 01, 2012 4:15 pm
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?