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

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.
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

THat is the check_url



define command {

command_name check_url
command_line $USER1$/check_url.pl $ARG1$
}


define service {
use production-service
host_name AWSSRVPRDIIS01
service_description ESPDATA.ORG.AU
check_command check_url!http://www.espdata.org.au/index.asp
}
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 - plugin may be mis

Post by scottwilkerson »

Ok, lets run the following and post the output

Code: Select all

su nagios -c '/usr/local/nagios/libexec/check_url.pl http://www.espdata.org.au/index.asp; echo $?'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

root@dalsrvitmon03:/usr/local/nagios/libexec# su nagios -c '/usr/local/nagios/libexec/check_url.pl http://www.espdata.org.au/index.asp; echo $?'
This account is currently not available.


hmmm i think i know what this is, but not 100%. maybe we dont have an account configured on the local server maybe?
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 - plugin may be mis

Post by scottwilkerson »

Something is wrong with the nagios user account
can you just su to the account?

Code: Select all

su nagios
is it expired?

Code: Select all

chage -l nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

scottwilkerson wrote:Something is wrong with the nagios user account
can you just su to the account?

Code: Select all

su nagios
is it expired?

Code: Select all

chage -l nagios

I dont remember ever setting this password when using apt install to install nagios3 core


ozadmin@dalsrvitmon03:~$ su nagios
Password:
su: Authentication failure
ozadmin@dalsrvitmon03:~$ chage -l nagios
chage: Permission denied.
ozadmin@dalsrvitmon03:~$ sudo -s
[sudo] password for ozadmin:
root@dalsrvitmon03:~# chage -l nagios
Last password change : Nov 12, 2019
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
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 - plugin may be mis

Post by scottwilkerson »

can you su nagios once you are root?

Code: Select all

su nagios
there should be no password on the nagios account unless you set one
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

scottwilkerson wrote:can you su nagios once you are root?

Code: Select all

su nagios
there should be no password on the nagios account unless you set one



root@dalsrvitmon03:~# su nagios
This account is currently not available.
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 - plugin may be mis

Post by scottwilkerson »

You may want to try to change the shell for the nagios user

Code: Select all

usermod --shell /bin/bash nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

that worked


root@dalsrvitmon03:/usr/local/nagios/libexec# su nagios
nagios@dalsrvitmon03:/usr/local/nagios/libexec$
kmartin2007
Posts: 66
Joined: Thu Nov 14, 2019 3:31 pm

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

Post by kmartin2007 »

Still says password is bad, no password was entered



ozadmin@dalsrvitmon03:~$ su nagios -c '/usr/local/nagios/libexec/check_url.pl http://www.espdata.org.au/index.asp; echo $?'
Password:
su: Authentication failure
ozadmin@dalsrvitmon03:~$ su nagios -c '/usr/local/nagios/libexec/check_url.pl http://www.espdata.org.au/index.asp; echo $?'
Password:
su: Authentication failure
ozadmin@dalsrvitmon03:~$
Locked