Page 2 of 2
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Mon Apr 11, 2016 4:06 pm
by akhilprasadpitta
Hello Support,
Please let me how can i start a new topic.
Akhil
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Mon Apr 11, 2016 4:18 pm
by tmcdonald
From the forum topic listing page:
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Tue Apr 12, 2016 6:58 pm
by McHenry
The plugin ownership of root:root is the same for all other plugins in the folder.
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Tue Apr 12, 2016 11:45 pm
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?
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Sun Apr 17, 2016 1:37 am
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.
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Sun Apr 17, 2016 6:23 pm
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$
}
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Sun Apr 17, 2016 8:55 pm
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
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Posted: Mon Apr 18, 2016 12:57 pm
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.