HP Switch 2530

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gazy007
Posts: 12
Joined: Thu Oct 02, 2014 9:02 am

HP Switch 2530

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HP Switch 2530

Post 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.
Former Nagios Employee
gazy007
Posts: 12
Joined: Thu Oct 02, 2014 9:02 am

Re: HP Switch 2530

Post by gazy007 »

The output is
-rwxr-xr-x. 1 nagios nagios 3295 Sep 26 2014 /usr/local/nagios/libexec/check_snmp_hp-procurve.sh
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: HP Switch 2530

Post by scottwilkerson »

Could you post the plugin to the forum, as well as the command definition in nagios that these checks are using?

Thanks!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
gazy007
Posts: 12
Joined: Thu Oct 02, 2014 9:02 am

Re: HP Switch 2530

Post 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.
Attachments
check_snmp_hp-procurve.sh
(3.22 KiB) Downloaded 496 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: HP Switch 2530

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
gazy007
Posts: 12
Joined: Thu Oct 02, 2014 9:02 am

Re: HP Switch 2530

Post 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]$
gazy007
Posts: 12
Joined: Thu Oct 02, 2014 9:02 am

Re: HP Switch 2530

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: HP Switch 2530

Post by mcapra »

Glad you were able to find a solution! Locking and marking as resolved.
Former Nagios employee
https://www.mcapra.com/
Locked