Page 1 of 1
HP Switch 2530
Posted: Fri May 27, 2016 4:13 am
by gazy007
Hi,
I have replaced our switches to HP 2530POE+ and Nagios core is showing "(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp_hp-procurve.sh, ...) failed. errno is 2: No such file or directory " and memory error SNMP CRITICAL - free *39918564* bytes . I have tried few changes and googled but you guys are my last resort to fix this issue.
Please advise.
Re: HP Switch 2530
Posted: Mon May 30, 2016 7:34 am
by rkennedy
Sounds like the permissions are wrong on the file, what is the output of
Code: Select all
ls -l /usr/local/nagios/libexec/check_snmp_hp-procurve.sh[/icode]? It should be the same as what the other plugins are in that folder.
Re: HP Switch 2530
Posted: Tue May 31, 2016 2:47 am
by gazy007
The output is
-rwxr-xr-x. 1 nagios nagios 3295 Sep 26 2014 /usr/local/nagios/libexec/check_snmp_hp-procurve.sh
Re: HP Switch 2530
Posted: Tue May 31, 2016 9:44 am
by scottwilkerson
Could you post the plugin to the forum, as well as the command definition in nagios that these checks are using?
Thanks!
Re: HP Switch 2530
Posted: Tue May 31, 2016 9:51 am
by gazy007
scottwilkerson wrote:Could you post the plugin to the forum, as well as the command definition in nagios that these checks are using?
Thanks!
I would try my best
define command {
command_name check_snmp_hp-procurve
command_line $USER1$/check_snmp_hp-procurve.sh public $HOSTADDRESS$
#command_line /usr/local/nagios/libexec/check_snmp_hp-procurve.sh public $HOSTADDRESS$
}
Plugin attached as well.
Re: HP Switch 2530
Posted: Tue May 31, 2016 4:20 pm
by tgriep
It could be that the new switches are not compatible with the plugin and that could be causing the error.
Can you login to the server and run the command manually as the nagios user and post the output here?
Run the following to do that, replacing xxx.xxx.xxx.xxx with the IP address of the HP device.
Code: Select all
su nagios
/usr/local/nagios/libexec/check_snmp_hp-procurve.sh public xxx.xxx.xxx.xxx
Re: HP Switch 2530
Posted: Wed Jun 01, 2016 2:44 am
by gazy007
As requested.
[root@nagios ~]# su nagios
[nagios@nagios root]$ /usr/local/nagios/libexec/check_snmp_hp-procurve.sh public 192.168.3.48
bash: /usr/local/nagios/libexec/check_snmp_hp-procurve.sh: /bin/bash^M: bad interpreter: No such file or directory
[nagios@nagios root]$
Re: HP Switch 2530
Posted: Wed Jun 01, 2016 4:15 am
by gazy007
Thanks for all your help but I managed to resolve it myself. I was downloading the script on a windows pc and moving over to linux pc using winscp. somehow it was causing the issue.
I set my notepad++ to unix mode in settings and created a new file and named it same as hp_snmp_hp-procurve.sh and paste the whole script in the new file and moved it again over my nagios server.
I run the command again as suggested
[root@nagios ~]# /usr/local/nagios/libexec/check_snmp_hp-procurve.sh public xxx.xxx.xxx.xxx
HP switch hardware is OK
I hope it helps others as well.
Re: HP Switch 2530
Posted: Wed Jun 01, 2016 9:49 am
by mcapra
Glad you were able to find a solution! Locking and marking as resolved.