Page 1 of 2
SNMP problem - No data received from host
Posted: Wed Aug 22, 2012 8:39 am
by bro969
HI All,
New to Linux and Nagios. I have managed to configure Nagios to monitor host devices. However, I still get errors (see below) monitoring interfaces via snmp. I have gone through a host of posts here and replicated some of the advices but still no success. Can someone please assist me in getting this right? I have snmp V3 configured on the device I am monitoring. Am not so sure why the IP address being monitored appears here (CMD: /usr/bin/snmpget -t 1 -r 5 -m RFC1213-MIB -v 1 [authpriv] 10.200.10.18:161 ifOperStatus.3/1/1), and not the address of the snmp server.
I'll appreciate any input.
Current Status: UNKNOWN (for 6d 23h 13m 32s)
Status Information: SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m RFC1213-MIB -v 1 [authpriv] 10.200.10.18:161 ifOperStatus.3/1/1
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 08-22-2012 14:21:25
Check Type: ACTIVE
Check Latency / Duration: 0.029 / 0.014 seconds
Next Scheduled Check: 08-22-2012 14:31:25
Last State Change: 08-15-2012 15:17:17
Last Notification: 08-22-2012 14:11:32 (notification 167)
Is This Service Flapping? NO (0.00% state change)
In Scheduled Downtime? NO
Last Update: 08-22-2012 14:30:42 ( 0d 0h 0m 7s ago)
Re: SNMP problem - No data received from host
Posted: Wed Aug 22, 2012 11:49 am
by yancy
bro969,
SNMP v3 uses user credentials, have you configured user credentials on the system your monitoring? if so, you need to provide those in your command line argument. or you can us "-v 2c" instead.
Regards,
-Yancy
Re: SNMP problem - No data received from host
Posted: Thu Aug 23, 2012 3:28 am
by bro969
Thanks Yancy,
I get your point. On the device I am monitoring, I have the following snmp command, "snmp-server host 1.1.1.1 version 3 auth <snmp username>". Where 1.1.1.1 represents the snmp host. In which command line argument do I need to configure the snmp V3 I have created?
What command should I include under check_command in /usr/local/nagios/etc/services.cfg. At the moment, I've got "check_snmp! -v 3 -u <username> -l authNoPriv -a MD5 -A <pass phrase> localhost sysUpTime.0".
Are there anywhere I need to make changes as well? Under /etc/snmp/snmpd.conf, I could not find any comment for snmp v3 to edit so I created these commands;
createUser <username>
rouser <username> authNoPriv 1.3.6.1.2.1.1
Not sure what the implication is, but only following some the advice I get online.
Pls pardon my ignore atimes.
Kind regards,
bro969
Re: SNMP problem - No data received from host
Posted: Thu Aug 23, 2012 12:13 pm
by yancy
bro969,
I would try testing against check_snmp from the command line first, and then defining your service check after that.
check_snmp should be located in <your nagios install path>/libexec/
I have nagios install at /usr/local/nagios, so all my check plugins are located in /usr/local/nagios/libexec
cd to your libexec
for example:
next run check_snmp to see required arguments
regards,
-Yancy
Re: SNMP problem - No data received from host
Posted: Tue Aug 28, 2012 3:51 am
by bro969
Thanks Yancy,
I have tested against check_snmp from the command line as advised. I have the following output below;
[ root on pts/0 ] (1059) # /usr/local/nagios/libexec/ [ ~ ]
[ root on pts/0 ] (1060) # ./check_snmp [ /usr/local/nagios/libexec ]
check_snmp: Could not parse arguments
Usage:check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]
[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]
[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]
[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]
[-A authpasswd] [-X privpasswd]
However, comparing what I have defined in services.cfg, that is, ("check_snmp! -v 3 -u <username> -l authNoPriv -a MD5 -A <pass phrase> localhost sysUpTime.0") to the above argument, could you please guide me with the check_command I need to define in services.cfg?
Also, is the -H <ip_address> from the above argument the IP address of my snmp server (this will be the same across all the devices to be monitored), as configured in my devices or will it be the IP address of each of the device I wish to monitor?
How do I get the OID values to use?
Thanks for your effort so far.
Kind regards,
bro
Re: SNMP problem - No data received from host
Posted: Tue Aug 28, 2012 10:26 am
by yancy
bro969,
The -H is the ipaddress or hostname of the SNMP device you wish to monitor.
Here is a example check_snmp command against a Cisco router:
Code: Select all
[root@CentOS6x86 libexec]# ./check_snmp -v 3 -u miami -A miami -H 192.168.5.233 -o sysUpTime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 192.168.5.233:161 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (33768795) 3 days, 21:48:07.95
SNMP OK - Timeticks: (33768795) 3 days, 21:48:07.95 miami |
[root@CentOS6x86 libexec]#
note that the user and password is "miami"
to find the OIDs your looking for, you could use something like snmpwalk.
Regards,
-Yancy
Re: SNMP problem - No data received from host
Posted: Wed Aug 29, 2012 6:33 am
by bro969
Thanks Yancy.
See what I get from ./check_snmp command;
[ root on pts/1 ] (1230) # ./check_snmp -v 3 u cisco -A ciscocisco -H localhost -o sysUpime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public localhost:161 sysUpime.0
SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] localhost:161 sysUpime.0
[ root on pts/1 ] (1231) #
However, when I do an snmpget as below, I get the below output;
[ root on pts/1 ] (1228) # snmpget -v 3 -u cisco -l authNoPriv -a MD5 -A ciscocisco localhost 1.3.6.1.2.1.1.1.0 [ ~ ]
SNMPv2-MIB::sysDescr.0 = STRING: Linux netflow-reflector.sis.tv 2.6.32-71.el6.i686 #1 SMP Fri Nov 12 04:17:17 GMT 2010 i686
Not sure why it shows SNMPv2-MIB...Am beginning to get frustrated, as I seem not to be getting the hang of it.
In services.cfg, based on the last output, what would you have in service definition? Would you have something in the line of;
# Service definition to monitor router uptime using check_snmp
define service{
use generic-service
host_name localhost
service_description Uptime
check_command check_snmp! -v 3 -u miami -A miami -H 192.168.5.233 -o sysUpTime.0
}
This is of the understanding that the hostname is localhost. Although I tried something similar on mine, but that didn't help.
I really appreciate your support so far.
Kind regards,
bro
Re: SNMP problem - No data received from host
Posted: Wed Aug 29, 2012 4:51 pm
by yancy
[ root on pts/1 ] (1230) # ./check_snmp -v 3 u cisco -A ciscocisco -H localhost -o sysUpime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public localhost:161 sysUpime.0
it looks like your missing the "-" in u.
Also, what type of device is this your monitoring? you might want to consult the vendor documentation for how to configure SNMP.
Regards,
-Yancy
Re: SNMP problem - No data received from host
Posted: Thu Aug 30, 2012 4:22 am
by bro969
Thanks.
I missed the "-" in u when typing. However, with that in place I recieve the output below;
[ root on pts/0 ] (1035) # ./check_snmp -v 3 -u cisco -l authPriv -a MD5 -A ciscocisco -H localhost -o sysUpTime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public localhost:161 sysUpTime.0
authPriv problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] localhost:161 sysUpTime.0
[ root on pts/0 ] (1036) # ./check_snmp -v 3 -u cisco -l authPriv -a MD5 -A ciscocisco -H 10.255.1.18 -o sysUpTime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.255.1.18:161 sysUpTime.0
authPriv problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 10.255.1.18:161 sysUpTime.0
[ root on pts/0 ] (1037) #
This time the problem appears to be authPriv. I have changed it to authNoPriv in services.cfg as shown below but still get same error.
check_snmp! -v 3 -u cisco -l authNoPriv -a MD5 -A ciscocisco -H localhost -o sysUpTime.0
All I've setup to monitor at the moment is the localhost which is the linux server hosting Nagios Core and a Cisco 3750X switch. Once I get it right, I will use the same template to add more devices.
Kind regards,
bro
Re: SNMP problem - No data received from host
Posted: Thu Aug 30, 2012 10:17 am
by yancy
bro969,
try formatting the command as in the example above
Code: Select all
[root@CentOS6x86 libexec]# ./check_snmp -v 3 -u miami -A miami -H 192.168.5.233 -o sysUpTime.0
That is a check I ran against a Cisco 2960 router.
Regards