NOOB: (Return code of 127 is out of bounds - plugin may be
NOOB: (Return code of 127 is out of bounds - plugin may be
I am a new user and have some basic monitoring working. I am interested in getting the following printer plugin working:
https://exchange.nagios.org/directory/P ... ck/details
The response I received for both services is:
"(Return code of 127 is out of bounds - plugin may be missing)"
I have checked the $USER1$ variable to confirm the plugin path:
root@apollo:~# grep "USER1" /etc/nagios3/resource.cfg
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/lib/nagios/plugins
The plugin is located in the correct location:
root@apollo:~# ls -l /usr/lib/nagios/plugins/check_snmp_printer.sh
-rwxr-xr-x 1 root root 32658 Mar 28 12:50 /usr/lib/nagios/plugins/check_snmp_printer.sh
in /etc/nagios3/command.cfg I have the following:
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
In /etc/nagios3/objects/printers.cfg I have the following two services defined:
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Toner Supply
check_command check_snmp_printer!public!"CONSUM Toners"!20!10
}
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Paper Supply
check_command check_snmp_printer!public!"TRAY ALL"!25%!0%
}
Any help would be greatly appreciated. Thanks in advance...
https://exchange.nagios.org/directory/P ... ck/details
The response I received for both services is:
"(Return code of 127 is out of bounds - plugin may be missing)"
I have checked the $USER1$ variable to confirm the plugin path:
root@apollo:~# grep "USER1" /etc/nagios3/resource.cfg
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/lib/nagios/plugins
The plugin is located in the correct location:
root@apollo:~# ls -l /usr/lib/nagios/plugins/check_snmp_printer.sh
-rwxr-xr-x 1 root root 32658 Mar 28 12:50 /usr/lib/nagios/plugins/check_snmp_printer.sh
in /etc/nagios3/command.cfg I have the following:
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
In /etc/nagios3/objects/printers.cfg I have the following two services defined:
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Toner Supply
check_command check_snmp_printer!public!"CONSUM Toners"!20!10
}
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Paper Supply
check_command check_snmp_printer!public!"TRAY ALL"!25%!0%
}
Any help would be greatly appreciated. Thanks in advance...
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Do you have selinux enabled?
You should disable it
Code: Select all
getenforce
Code: Select all
setenforce 0
Rob Hassing
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Thanks Rob. SELinux was already disabled.
root@apollo:~# getenforce
Disabled
root@apollo:~#
root@apollo:~# getenforce
Disabled
root@apollo:~#
Re: NOOB: (Return code of 127 is out of bounds - plugin may
What happens if you run the command from the command line?
Rob Hassing
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Code: Select all
root@apollo:~# ls -l /usr/lib/nagios/plugins/check_snmp_printer.sh
-rwxr-xr-x 1 root root 32658 Mar 28 12:50 /usr/lib/nagios/plugins/check_snmp_printer.sh
If you run the check over the CLI, does it work fine?
Former Nagios Employee
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Hi Rob and thanks once again. The file permissions are the same as the others in the folder:
root@apollo:/usr/lib/nagios/plugins# ls -l check_s*
-rwxr-xr-x 1 root root 1453 Mar 13 2014 check_sensors
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_simap -> check_tcp
-rwxr-xr-x 1 root root 64216 Mar 13 2014 check_smtp
-rwxr-xr-x 1 root root 72936 Mar 13 2014 check_snmp
-rwxr-xr-x 1 root root 32658 Mar 28 12:50 check_snmp_printer.sh
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_spop -> check_tcp
-rwxr-xr-x 1 root root 43384 Mar 13 2014 check_ssh
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_ssmtp -> check_tcp
-rwxr-xr-x 1 root root 43240 Mar 13 2014 check_swap
From the CLI it appears to run fine.
root@apollo:/usr/lib/nagios/plugins# ./check_snmp_printer.sh -V
check_snmp_printer.sh - version 3.14159
root@apollo:/usr/lib/nagios/plugins# ./check_snmp_printer.sh -H 192.1.1.152 -C public -x MODEL
"Canon LBP6300 1.01", Serial #
root@apollo:/usr/lib/nagios/plugins# ls -l check_s*
-rwxr-xr-x 1 root root 1453 Mar 13 2014 check_sensors
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_simap -> check_tcp
-rwxr-xr-x 1 root root 64216 Mar 13 2014 check_smtp
-rwxr-xr-x 1 root root 72936 Mar 13 2014 check_snmp
-rwxr-xr-x 1 root root 32658 Mar 28 12:50 check_snmp_printer.sh
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_spop -> check_tcp
-rwxr-xr-x 1 root root 43384 Mar 13 2014 check_ssh
lrwxrwxrwx 1 root root 9 Mar 13 2014 check_ssmtp -> check_tcp
-rwxr-xr-x 1 root root 43240 Mar 13 2014 check_swap
From the CLI it appears to run fine.
root@apollo:/usr/lib/nagios/plugins# ./check_snmp_printer.sh -V
check_snmp_printer.sh - version 3.14159
root@apollo:/usr/lib/nagios/plugins# ./check_snmp_printer.sh -H 192.1.1.152 -C public -x MODEL
"Canon LBP6300 1.01", Serial #
Re: NOOB: (Return code of 127 is out of bounds - plugin may
I did find an error in the command definition whereby it was missing two "$" I have now updated it from:
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
to
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}
I have also updated my service checks to use the new command name "check_printers":
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Paper Supply
check_command check_printers!public!"TRAY ALL"!25%!0%
}
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$
}
to
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}
I have also updated my service checks to use the new command name "check_printers":
define service{
use generic-service
hostgroups hp-printers ; The name of the host the service is associated with
service_description Paper Supply
check_command check_printers!public!"TRAY ALL"!25%!0%
}
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Is this working correctly after you made those changes?
Former Nagios Employee.
me.
me.
Re: NOOB: (Return code of 127 is out of bounds - plugin may
Unfortunately not.
I have restarted the server however the error remains.
I have restarted the server however the error remains.
Re: NOOB: (Return code of 127 is out of bounds - plugin may
The permissions should not be root:root, they should be set to the user / group you're going to execute them as. For reference, did you follow some sort of guide when installing your plugins?
Former Nagios Employee