(Return code of 127 is out of bounds.) - Check_sap

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.
paulo.ferreira
Posts: 32
Joined: Wed Feb 26, 2020 10:26 am

(Return code of 127 is out of bounds.) - Check_sap

Post by paulo.ferreira »

Anyone could help me with this error, i try everything but still receive the 127 error:
Follow below and in attachment my cfg, for this service and plugin.
Ps: If I run the plugin manually works fine, but when I define as a service, show the message (Return code of 127 is out of bounds. Check if plugin exists) .


Plugin permissions:
-rwxrwxrwx. 1 nagios nagios 13625 Sep 24 11:55 check_sap

commands.cfg
define command {

command_name check_sap
command_line $USER1$/check_sap 01 $ARG1$
}

service definition
define service{
use generic-service
host_name EM01VS0206
service_description SAP Response Time
check_command check_sap!EP1
}


In attachment
the plugin
nagios.cfg
resources.cfg


Thank you
Attachments
nagios.zip
(18.53 KiB) Downloaded 141 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by scottwilkerson »

What is the output of the following commands

Code: Select all

ls -l /usr/local/nagios/libexec/check_sap
su nagios -c '/usr/local/nagios/libexec/check_sap 01 EP1'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
paulo.ferreira
Posts: 32
Joined: Wed Feb 26, 2020 10:26 am

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by paulo.ferreira »

Follow the outputs

[root@em01vs0326 objects]# su nagios -c '/usr/local/nagios/libexec/check_sap 01 EP1'
FrontEndNetTime=0msec | FrontEndNetTime=0msec;3000.000000;5000.000000;0;
[root@em01vs0326 objects]# ls -l /usr/local/nagios/libexec/check_sap
-rwxrwxrwx. 1 nagios nagios 13625 Sep 24 11:55 /usr/local/nagios/libexec/check_sap
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by scottwilkerson »

That does seem odd, is it possible to look at the nagios.log to see if any erros show with that plugin name

Code: Select all

grep check_sap /usr/local/nagios/var/nagios.log
also

Code: Select all

grep check_sap /usr/local/nagios/var/objects.cache
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
paulo.ferreira
Posts: 32
Joined: Wed Feb 26, 2020 10:26 am

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by paulo.ferreira »

[root@em01vs0326 objects]# grep check_sap /usr/local/nagios/var/nagios.log
[root@em01vs0326 objects]# grep check_sap /usr/local/nagios/var/objects.cache
command_name check_sap
command_line $USER1$/check_sap 01 $ARG1$
command_name check_sap_abortedjobs
command_line $USER1$/check_sap 02 $ARG1$
command_name check_sap_cpu
command_line $USER1$/check_sap 07 $ARG1$
command_name check_sap_response
command_line $USER1$/check_sap $HOSTADDRESS$ 01 $ARG1$
command_name check_sap_shortdumpsfrenq
command_line $USER1$/check_sap $HOSTADDRESS$ 03 '$ARG1$'
command_name check_sap_sqlerror
command_line $USER1$/check_sap 00 '$ARG1$'
check_command check_sap_abortedjobs!'QA0'
check_command check_sap_cpu!QA0
check_command check_sap_response!QA0
check_command check_sap_sqlerror!QA0
check_command check_sap_shortdumpsfrenq!QA0
check_command check_sap!EP1
check_command check_sap!EP0
check_command check_sap!01!EP1
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by scottwilkerson »

Are you sure it is the "SAP Response Time" service on EM01VS0206 that is giving this error?

Can you show the output of the following so we can make sure there isn't multiple nagios parent processes running somehow:

Code: Select all

ps -ef|grep nagios.cfg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
paulo.ferreira
Posts: 32
Joined: Wed Feb 26, 2020 10:26 am

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by paulo.ferreira »

The output and in attachment the print from the nagios CORE.

[root@em01vs0326 ~]# ps -ef|grep nagios.cfg
nagios 18824 1 1 08:30 ? 00:00:25 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 18845 18824 0 08:30 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 23639 23300 0 08:55 pts/1 00:00:00 grep --color=auto nagios.cfg
Attachments
print.PNG
print.PNG (5.06 KiB) Viewed 2934 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by scottwilkerson »

Can you please zip and PM me your /usr/local/nagios/var/objects.cache

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by scottwilkerson »

I looked over the PM you sent and I cannot see any reason why you would be getting this error unless there is something encoded in the check_sap that is not using a full path to a file, but you previously posted a binary which I do not know where it came from so I cannot use it.

All I can suggest would be to change your nagios.cfg to set

Code: Select all

debug_level=272
restart nagios, then wait 5-10 minutes and send the output of

Code: Select all

grep check_sap /usr/local/nagios/var/nagios.debug
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
paulo.ferreira
Posts: 32
Joined: Wed Feb 26, 2020 10:26 am

Re: (Return code of 127 is out of bounds.) - Check_sap

Post by paulo.ferreira »

(No output on stdout) stderr: /usr/local/nagios/libexec/check_sap: error while loading shared libraries: sap_moni.so: cannot open shared object file: No such file or directory
[root@em01vs0326 ~]#
Locked