Page 1 of 1

Nagiosxi update - Return code of 127 is out of bounds

Posted: Fri Oct 27, 2023 11:06 am
by dhoran
hi,

We are running nagiosxi 5.11.1 on RHEL 8, using python 3.6.8. The system is running - we have the GUI and command line checks also work. We installed nagiosxi thru the repo.
We have tried to run the nagiosxi update thru the web interface separate from the OS updates and we have also tried running yum update to handle both OS and nagiosxi - we end up with the same issue either way we run updates

# python --version
Python 3.6.8
#which python3
/usr/bin/python3

what is listed in /usr/bin for python
# ls -l /usr/bin/pyt*
lrwxrwxrwx. 1 root root 25 Feb 28 2020 /usr/bin/python3 -> /etc/alternatives/python3
lrwxrwxrwx. 1 root root 31 Aug 11 2021 /usr/bin/python3.6 -> /usr/libexec/platform-python3.6
lrwxrwxrwx. 1 root root 32 Aug 11 2021 /usr/bin/python3.6m -> /usr/libexec/platform-python3.6m

We can run the updates and there are no errors, but once we restart - in the GUI the clients get the error: Return code of 127 is out of bounds. Check if plugin exists.
When using the CLI:
#/usr/local/nagios/libexec/check_ncpa.py -t "passwd" -H 10.x.x.x -M memory/virtual -w 90 -c 95 -u G
/usr/bin/env: ‘python’: No such file or directory

1. How do I resolve this ?

2. If the system is running before the update without 'python' - why does it need it after the update ?

Re: Nagiosxi update - Return code of 127 is out of bounds

Posted: Fri Oct 27, 2023 2:25 pm
by ssunga
Thanks for reaching out@dhoran,

It looks like when you run the check_ncpa script, it's look for `python` but as your `which` and `ls` show, you have python3 and python3.6


Try doing `python3` or `python3.6` instead of `python`.

Try changing the shebang in the first part of the check_ncpa script to p

#!/usr/bin/env python3 or #!/usr/bin/env python3.6

If you wanna use just `python`, do

sudo ln -s /usr/bin/python3 /usr/bin/python

Re: Nagiosxi update - Return code of 127 is out of bounds

Posted: Fri Oct 27, 2023 3:40 pm
by bbahn
  1. It seems that your system is trying to use the python command, but your system only has python3 in its path. The following command should fix this issue.

Code: Select all

sudo ln -s /usr/bin/python3 /usr/bin/python
2. Several python scripts were recently updated. I wasn't involved in this so I don't know the details, but it's possible that these updates are at fault.

If your problem persists, please respond in this thread so we can help alleviate the issue.

Re: Nagiosxi update - Return code of 127 is out of bounds

Posted: Mon Oct 30, 2023 10:24 am
by dhoran
Checking the .py files in /usr/local/nagios/libexec - the monitoring scripts we are using are all configured similar to below, using python3:

[root@aerobic libexec]# more check_ncpa.py
#!/usr/bin/env python3


When I run the update (either CLI or GUI) the new check_ncpa.py - has /usr/bin/env python

I missed this when trouble shooting the incident after the update. Since we are not using python, our configuration is python3. I updated the check_ncpa.py to use python3, instead of doing the link python to python3.

So it seems like I will need to keep on eye on the scripts that we use in /usr/local/nagios/libexec when running updates.

Re: Nagiosxi update - Return code of 127 is out of bounds

Posted: Mon Oct 30, 2023 11:33 am
by jsimon
Hi @dhoran,

It looks like your issue is resolved from your previous post, but I want to make sure you're squared away before locking the topic. Do you have any other questions related to this topic?

Re: Nagiosxi update - Return code of 127 is out of bounds

Posted: Mon Oct 30, 2023 1:16 pm
by dhoran
Hi,

Yes I think I'm good nagios is running. I just need to keep an eye on the .py scripts in nagios/libexec after updates.

thanks