NOOB: (Return code of 127 is out of bounds - plugin may be

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.
akhilprasadpitta
Posts: 1
Joined: Mon Apr 11, 2016 3:54 pm

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by akhilprasadpitta »

Hello Support,

Please let me how can i start a new topic.

Akhil
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by tmcdonald »

From the forum topic listing page:
2016-04-11 16_17_20-View forum - Nagios Core • Nagios Support Forum.png
Former Nagios employee
McHenry
Posts: 16
Joined: Thu Jan 15, 2015 5:01 pm

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by McHenry »

The plugin ownership of root:root is the same for all other plugins in the folder.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by Box293 »

The nagios user the one that does the actual executing, which is different from the root user.

What happens when you execute these commands:

Code: Select all

su nagios
/usr/lib/nagios/plugins/check_snmp_printer.sh -H 192.1.1.152 -C public -x MODEL
rkennedy wrote:For reference, did you follow some sort of guide when installing your plugins?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
McHenry
Posts: 16
Joined: Thu Jan 15, 2015 5:01 pm

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by McHenry »

root@apollo:~# su nagios
root@apollo:~# /usr/lib/nagios/plugins/check_snmp_printer.sh -H 192.1.1.152 -C public -x MODEL
"HP LaserJet M402dn", Serial # XXXXXXXXXX
root@apollo:~#

When installing the plugin I simply downloaded the bash script from the website, copied it into the plugins folder and set the permissions to match the other files in the folder.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by Box293 »

McHenry wrote:

Code: Select all

define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}
McHenry wrote:

Code: Select all

root@apollo:~# su nagios
root@apollo:~# /usr/lib/nagios/plugins/check_snmp_printer.sh -H 192.1.1.152 -C public -x MODEL
"HP LaserJet M402dn", Serial # XXXXXXXXXX
root@apollo:~# 
When installing the plugin I simply downloaded the bash script from the website, copied it into the plugins folder and set the permissions to match the other files in the folder.
Here is your problem, in your command definition the name of the plugin is missing the .sh from end, it should be:

Code: Select all

define command{
command_name check_printers
command_line $USER1$/check_snmp_printer.sh -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
McHenry
Posts: 16
Joined: Thu Jan 15, 2015 5:01 pm

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by McHenry »

Awesome, thank you.

I copied the original command from the Nagios website so I'm surprised others have not noted this problem:
https://exchange.nagios.org/directory/P ... 1458605971
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NOOB: (Return code of 127 is out of bounds - plugin may

Post by rkennedy »

The script there is actually uploaded without the .sh extension. It will work either way, though.

Going to mark this thread as resolved, and close it up.
Former Nagios Employee
Locked