Page 1 of 1
Problem with SNMP plugin
Posted: Fri Jun 27, 2014 4:26 pm
by blinker86
Hi
I'm newbie in using Nagios, I've just installed my first server and I'm doing my tests with my switches. But I have a problem when I want to check the status of the port:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory
I'm install the last plugins but the plugin check_snmp not appear.
Code: Select all
[root@tecmint nagios]# cd /root/nagios
[root@tecmint nagios]# cd nagios-plugins-2.0.3
[root@tecmint nagios]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@tecmint nagios]# make
[root@tecmint nagios]# make install
Could you help me?
Re: Problem with SNMP plugin
Posted: Mon Jun 30, 2014 11:09 am
by tmcdonald
I see you are on plugins v2.0.3. What OS and version is this running on? And what Nagios version?
Re: Problem with SNMP plugin
Posted: Mon Jun 30, 2014 2:56 pm
by blinker86
I read about the problem and I solved the problem:
Hi
check_snmp is part of the nagios-plugins but it won't compile it if you don't have net-snmp, as indicated in the REQUIREMENTS file included with nagios-plugins...
Code: Select all
[root@localhost nagios-plugins-1.4.11]# cat REQUIREMENTS
Nagios Plugin Requirements
--------------------------
Some plugins require that you have additional programs and/or
libraries installed on your system before they can be used. Plugins
that are dependent on other programs/libraries that are missing are
usually not compiled. Requirements for various plugins are listed
below...
...
check_snmp:
- Requires the NET-SNMP package available from
http://net-snmp.sourceforge.net/
...
.
Install net-snmp and recompile the plugins, then you should have check_snmp.
Now I have othe problem. I need to check my switch Cisco SG300-52 but I have the following error when I want to see the status:
External command error: Timeout: No Response from 10.120.5.31:161.
I've defined my host:
Code: Select all
define host{
use generic-switch ; Inherit default values from a template
host_name SW03 ; The name we're giving to this switch
alias Switch SG300-52 ; A longer name associated with the switch
address 10.120.5.31 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
And the services
Code: Select all
# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name SW03 ; The name of the host the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
# Monitor uptime via SNMP
define service{
use generic-service ; Inherit values from a template
host_name SW03
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
host_name SW03
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}
Could you help me?
Re: Problem with SNMP plugin
Posted: Mon Jun 30, 2014 3:09 pm
by sreinhardt
Have you opened and configured snmp on that device? We can test with:
Re: Problem with SNMP plugin
Posted: Mon Jun 30, 2014 4:17 pm
by blinker86
Yes, the snmp is avaible
Code: Select all
[root@nagios ~]# nmap -sU -p 161 10.120.5.31
Starting Nmap 5.51 ( http://nmap.org ) at 2014-06-30 16:16 PET
Nmap scan report for 10.120.5.31
Host is up (0.0031s latency).
PORT STATE SERVICE
161/udp open snmp
MAC Address: 6C:20:56:85:E1:4D (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 0.47 seconds
Re: Problem with SNMP plugin
Posted: Mon Jun 30, 2014 7:31 pm
by Box293
Have you configured that Cisco device with the communiity name public, which allows your Nagios Host read access?
A great test of SNMP is to perform a SNMP Walk.
Code: Select all
snmpwalk -c public -v 2c 10.120.5.31
Re: Problem with SNMP plugin
Posted: Tue Jul 01, 2014 12:36 pm
by blinker86
Thanks for the information. I configured the comunity name y the switch and now ir worked. Then i use the comand:
Code: Select all
snmpwalk -v1 -c public10.120.5.31 -m ALL .1
To see the name of the interfaces
Tank you very much!