Having issues getting SNMP working
Posted: Thu Apr 21, 2016 2:30 pm
Hello! I'm somewhat new to Nagios. I've used it before at other companies, but this is the first time I'm setting it up from scratch, and I'm having issues with the SNMP checks.
I got the Nagios/Check_MK/OMD install done, and all seemed to go well, but when I add a host, the SNMP checks fail. I followed the instructions I found here: http://www.liquidweb.com/kb/how-to-inst ... on-centos/, and got SNMP installed (for now, the /etc/snmp/snmpd.conf is the exact same as whats in that article.)
- I can tell that the snmpd service is running via ps
- I can see its listening on port 161/udp via lsof
- I added ALL: ALL: ALLOW to /etc/hosts.allow just to be sure that's not rejecting anything
- Firewall is open for 161/udp (I actually turned it off on both servers for troubleshooting)
- I can tell the connection from the nagios server to the client is made via watching the output of tcpdump and tailing /var/log/messages
If it helps, heres the output of some of the logs on the client that are generated when I execute the ./check_snmp above:
If anyone has anything that can help, it would be much appreciated! Thanks
I got the Nagios/Check_MK/OMD install done, and all seemed to go well, but when I add a host, the SNMP checks fail. I followed the instructions I found here: http://www.liquidweb.com/kb/how-to-inst ... on-centos/, and got SNMP installed (for now, the /etc/snmp/snmpd.conf is the exact same as whats in that article.)
Debugging Details:[root@server plugins]# ./check_snmp -H 192.168.1.34 -P 2c -C 209ijvfwer0df92jd -o ifOperStatus.1 -P 1
External command error: Timeout: No Response from 192.168.1.34:161.
- I can tell that the snmpd service is running via ps
- I can see its listening on port 161/udp via lsof
- I added ALL: ALL: ALLOW to /etc/hosts.allow just to be sure that's not rejecting anything
- Firewall is open for 161/udp (I actually turned it off on both servers for troubleshooting)
- I can tell the connection from the nagios server to the client is made via watching the output of tcpdump and tailing /var/log/messages
If it helps, heres the output of some of the logs on the client that are generated when I execute the ./check_snmp above:
I found this thread: https://support.nagios.com/forum/viewto ... 0&p=104344 which apparently the solution was to add -P 2c to the command, which you can see I did above, but it didn't work.[root@server ~]# tail -n 0 -f /var/log/messages /var/log/secure /var/log/firewalld
==> /var/log/messages <==
==> /var/log/secure <==
==> /var/log/firewalld <==
==> /var/log/messages <==
Apr 21 15:28:41 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:42 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:43 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:44 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:45 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:46 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.38]:39158->[192.168.1.34]:161
Apr 21 15:28:46 silo-stg-a01 snmpd[11608]: Connection from UDP: [192.168.1.160]:59707->[192.168.1.34]:161
If anyone has anything that can help, it would be much appreciated! Thanks