Return code of 127 is out of bounds.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Return code of 127 is out of bounds.

Post by sneha.irali »

Hi Team,

We have a windows NCPA agent on the Windows machine, the polling was working fine until the IP change was performed on the nagios server.

Although the IP is reverted back to the old one, but I see the below error on the console.

(Return code of 127 is out of bounds. Check if plugin exists)

--- Few o/p from the nagios command line-------
[root@jub01nagnmsp1 libexec]# which env
/bin/env
[root@jub01nagnmsp1 libexec]# ls -l /usr/bin/env
-rwxr-xr-x 1 root root 42472 Apr 27 2020 /usr/bin/env
[root@jub01nagnmsp1 libexec]# python -V
bash: python: command not found...
[root@jub01nagnmsp1 libexec]# python --version
bash: python: command not found...
[root@jub01nagnmsp1 libexec]# which python
/usr/bin/which: no python in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@jub01nagnmsp1 libexec]# ./check_ncpa.py -H 10.30.3.150 -t 'Nagios' -P 5693 -M cpu/percent -w '80' -c '90' -q 'aggregate=avg'
/usr/bin/env: ‘python’: No such file or directory
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Return code of 127 is out of bounds.

Post by vtrac »

Hi,
Any way, looks like your don't have "python" installed or it is installed somewhere else ... or maybe you have "python3" installed instead.

Please run this on your Nagios XI prompt and update outputs:

Code: Select all

yum list installed python
If python is NOT installed, please run the below command to install it:

Code: Select all

yum install python
Now, please try your "check_napa.py" command agin.


If you already have python installed, but maybe "python3", then find out what is it (and update outputs):

Code: Select all

cd /usr/bin
ls -lrth python*
Once you have determined the path of your "python", then link it.

Example, if my python path is:

Code: Select all

/usr/bin/python3.6
Now, Link it:

Code: Select all

cd /usr/bin
unlink python
ln -s /usr/bin/python3.6 python
Now, please try your "check_ncpa.py" command again.


Best Rebards,
Vinh
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: Return code of 127 is out of bounds.

Post by sneha.irali »

Hi Vinh,

I run the commands given by you:

[root@jub01nagnmsp1 ~]# yum list installed python
Error: No matching Packages to list
[root@jub01nagnmsp1 ~]# yum install python
Last metadata expiration check: 0:14:00 ago on Tue 20 Apr 2021 03:38:56 PM +03.
No match for argument: python
There are following alternatives for "python": python2, python36, python38
Error: Unable to find a match: python
[root@jub01nagnmsp1 ~]# cd /usr/bin
[root@jub01nagnmsp1 bin]# ls -lrth python*
lrwxrwxrwx. 1 root root 46 Nov 4 07:04 python3.6m-x86_64-config -> /usr/libexec /platform-python3.6m-x86_64-config
lrwxrwxrwx. 1 root root 39 Nov 4 07:04 python3.6m-config -> /usr/libexec/platfo rm-python3.6m-config
lrwxrwxrwx 1 root root 32 Nov 4 07:04 python3.6m -> /usr/libexec/platform-pyth on3.6m
lrwxrwxrwx. 1 root root 17 Nov 4 07:04 python3.6-config -> python3.6m-config
lrwxrwxrwx 1 root root 31 Nov 4 07:04 python3.6 -> /usr/libexec/platform-pytho n3.6
lrwxrwxrwx. 1 root root 25 Mar 17 11:35 python3 -> /etc/alternatives/python3
lrwxrwxrwx. 1 root root 32 Mar 17 11:35 python3-config -> /etc/alternatives/pyth on3-config
lrwxrwxrwx 1 root root 18 Apr 19 20:22 python -> /usr/bin/python3.8
[root@jub01nagnmsp1 bin]# unlink python
[root@jub01nagnmsp1 bin]# ln -s /usr/bin/python3.6
ln: failed to create symbolic link './python3.6': File exists
[root@jub01nagnmsp1 bin]#
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Return code of 127 is out of bounds.

Post by vtrac »

Hi,
What is the OS of this VM (machine)?
Is this your Nagios XI machine or another remote machine which has NCPA installed?

looking at the output of "ls -lrth python*", why are there "space" in the "name" or "path".

Code: Select all

lrwxrwxrwx. 1 root root 46 Nov 4 07:04 python3.6m-x86_64-config -> /usr/libexec /platform-python3.6m-x86_64-config
lrwxrwxrwx. 1 root root 39 Nov 4 07:04 python3.6m-config -> /usr/libexec/platfo rm-python3.6m-config
lrwxrwxrwx 1 root root 32 Nov 4 07:04 python3.6m -> /usr/libexec/platform-pyth on3.6m
lrwxrwxrwx. 1 root root 17 Nov 4 07:04 python3.6-config -> python3.6m-config
lrwxrwxrwx 1 root root 31 Nov 4 07:04 python3.6 -> /usr/libexec/platform-pytho n3.6
lrwxrwxrwx. 1 root root 25 Mar 17 11:35 python3 -> /etc/alternatives/python3
lrwxrwxrwx. 1 root root 32 Mar 17 11:35 python3-config -> /etc/alternatives/pyth on3-config
lrwxrwxrwx 1 root root 18 Apr 19 20:22 python -> /usr/bin/python3.8
Looks like you already have python3 installed.
However, I am not sure if it is 3.6 or 3.8 .... very confusing.

Also, you were missing the "python" when running the "ln -s .... " command.

It would be best that you ask your Unix-sysadmin to install "python" and setup it up for you.

Or, you could try install it your self (I can help) but first I need to know what "python" already installed.
Please run this and update outputs:

Code: Select all

rpm -qa | grep "^python"
Also, it is very important that you let me know what OS is this machine so we can try to install the correct package.

Also, I need to know if this is your remote machine which has NCPA installed or is this your Nagios XI machine.


Best Regards,
Vinh
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: Return code of 127 is out of bounds.

Post by sneha.irali »

VM OS - CENT OS 8
Yes NAgios MAchine

here is the o/p

[root@jub01nagnmsp1 ~]# rpm -qa | grep "^python"
python3-pytz-2017.2-9.el8.noarch
python3-slip-0.6.4-11.el8.noarch
python3-rpm-macros-3-39.el8.noarch
python3-kickstart-3.16.11-1.el8.noarch
python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64
python3-beautifulsoup4-4.6.3-2.el8.1.noarch
python3-inotify-0.9.6-13.el8.noarch
python3-syspurpose-1.27.16-1.el8.x86_64
python3-numpy-1.14.3-9.el8.x86_64
python3-gpg-1.13.1-3.el8.x86_64
python3-dnf-4.2.23-4.el8.noarch
python3-ordered-set-2.0.2-4.el8.noarch
python3-pyparsing-2.1.10-7.el8.noarch
python3-rhnlib-2.8.6-8.module_el8.1.0+211+ad6c0bc7.noarch
python3-pysocks-1.6.8-3.el8.noarch
python3-libs-3.6.8-31.el8.x86_64
python3-firewall-0.8.2-2.el8.noarch
python3-rrdtool-1.7.0-16.el8.x86_64
python3-jmespath-0.9.0-11.el8.noarch
python3-asn1crypto-0.24.0-3.el8.noarch
python3-newt-0.52.20-11.el8.x86_64
python3-cups-1.9.72-21.el8.0.1.x86_64
python3-sssdconfig-2.3.0-9.el8.noarch
python3-decorator-4.2.1-2.el8.noarch
python3-pyudev-0.21.0-7.el8.noarch
python36-3.6.8-2.module_el8.3.0+562+e162826a.x86_64
python3-simplejson-3.17.0-2.el8.x86_64
python3-meh-gui-0.47.2-1.el8.noarch
python3-requests-ftp-0.3.1-11.el8.noarch
python3-dnf-plugin-spacewalk-2.8.5-11.module_el8.1.0+211+ad6c0bc7.noarch
python3-productmd-1.11-3.el8.noarch
python3-dmidecode-3.12.2-15.el8.x86_64
python3-iniparse-0.4-31.el8.noarch
python-rpm-macros-3-39.el8.noarch
python3-systemd-234-8.el8.x86_64
python3-babel-2.5.1-5.el8.noarch
python3-html5lib-0.999999999-6.el8.noarch
python3-pyOpenSSL-18.0.0-1.el8.noarch
python3-libreport-2.9.5-15.el8.x86_64
python3-libxml2-2.9.7-8.el8.x86_64
python3-urllib3-1.24.2-4.el8.noarch
python3-louis-2.6.2-21.el8.noarch
python3-pid-2.1.1-7.el8.noarch
python3-slip-dbus-0.6.4-11.el8.noarch
python3-configobj-5.0.6-11.el8.noarch
python-srpm-macros-3-39.el8.noarch
python3-markupsafe-0.23-19.el8.x86_64
python3-cffi-1.11.5-5.el8.x86_64
python3-lxml-4.2.3-1.el8.x86_64
python3-libcomps-0.1.11-4.el8.x86_64
python3-gobject-base-3.28.3-2.el8.x86_64
python3-libstoragemgmt-clibs-1.8.3-2.el8.x86_64
python3-bind-9.11.20-5.el8_3.1.noarch
python3-setuptools-39.2.0-6.el8.noarch
python3-nftables-0.9.3-16.el8.x86_64
python3-blockdev-2.24-1.el8.x86_64
python3-blivet-3.2.2-6.el8.noarch
python3-libselinux-2.9-4.el8_3.x86_64
python3-langtable-0.0.51-4.el8.noarch
python3-rhn-client-tools-2.8.16-13.module_el8.1.0+211+ad6c0bc7.x86_64
python3-speechd-0.8.8-6.el8.x86_64
python3-six-1.11.0-8.el8.noarch
python3-dbus-1.2.4-15.el8.x86_64
python3-cairo-1.16.3-6.el8.x86_64
python3-rpm-4.14.3-4.el8.x86_64
python3-bcrypt-3.1.6-2.el8.1.x86_64
python3-pycparser-2.14-14.el8.noarch
python36-devel-3.6.8-2.module_el8.3.0+562+e162826a.x86_64
python3-chardet-3.0.4-7.el8.noarch
python3-meh-0.47.2-1.el8.noarch
python3-unbound-1.7.3-14.el8.x86_64
python3-pcp-5.1.1-3.el8.x86_64
python3-pwquality-1.4.0-9.el8.x86_64
python3-pyyaml-3.12-12.el8.x86_64
python3-hwdata-2.3.6-3.el8.noarch
python3-policycoreutils-2.9-9.el8.noarch
python3-pydbus-0.6.0-5.el8.noarch
python3-bytesize-1.4-3.el8.x86_64
python3-pyatspi-2.26.0-6.el8.noarch
python3-dateutil-2.6.1-6.el8.noarch
python3-pyparted-3.11.0-13.el8.x86_64
python3-idna-2.5-5.el8.noarch
python3-pyasn1-0.3.7-6.el8.noarch
python3-cssselect-0.9.2-10.el8.noarch
python3-cryptography-2.3-3.el8.x86_64
python3-setools-4.3.0-2.el8.x86_64
python3-libstoragemgmt-1.8.3-2.el8.noarch
python3-setuptools-wheel-39.2.0-6.el8.noarch
python3-pynacl-1.3.0-5.el8.x86_64
python3-dnf-plugins-core-4.0.17-5.el8.noarch
python3-hawkey-0.48.0-5.el8.x86_64
python3-requests-2.20.0-2.1.el8_1.noarch
python3-netifaces-0.10.6-4.el8.x86_64
python3-pip-wheel-9.0.3-18.el8.noarch
python3-brlapi-0.6.7-28.el8.x86_64
python3-linux-procfs-0.6.2-2.el8.noarch
python3-pip-9.0.3-18.el8.noarch
python3-rpm-generators-5-6.el8.noarch
python3-requests-file-1.4.3-5.el8.noarch
python3-dasbus-1.2-2.el8.noarch
python3-subscription-manager-rhsm-1.27.16-1.el8.x86_64
python3-jinja2-2.10.1-2.el8_0.noarch
python3-schedutils-0.6-6.el8.x86_64
python3-gobject-3.28.3-2.el8.x86_64
python3-libsemanage-2.9-3.el8.x86_64
python3-ntplib-0.3.3-10.el8.noarch
python3-paramiko-2.4.3-1.el8.noarch
python3-ply-3.9-8.el8.noarch
python3-pycurl-7.43.0.2-4.el8.x86_64
python3-libdnf-0.48.0-5.el8.x86_64
python3-pyxdg-0.25-16.el8.noarch
python3-librepo-1.12.0-2.el8.x86_64
python3-perf-4.18.0-240.15.1.el8_3.x86_64
python3-simpleline-1.1.1-2.el8.noarch
python3-webencodings-0.5.1-6.el8.noarch
python3-ethtool-0.14-3.el8.x86_64
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Return code of 127 is out of bounds.

Post by vtrac »

Hi,
Looks like you do have pyhton3.6 installed.

Let try this (as user "root"):

Code: Select all

ln -s /usr/bin/python3.6 /usr/bin/python
Now try this:

Code: Select all

which python
The above command should print "/usr/bin/python"

Now you are ready to test out the "check_ncpa.py" command.

Best Regards,
Vinh
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: Return code of 127 is out of bounds.

Post by sneha.irali »

Hi Team,

IT do not seems to be working yet:


[root@jub01nagnmsp1 ~]# ln -s /usr/bin/python3.6 /usr/bin/python
[root@jub01nagnmsp1 ~]# which python
/bin/python
[root@jub01nagnmsp1 ~]# ./check_ncpa.py -H 10.30.3.150 -t 'Nagios' -P 5693 -M cpu/percent -w '80' -c '90' -q 'aggregate=avg'
-bash: ./check_ncpa.py: No such file or directory
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: Return code of 127 is out of bounds.

Post by sneha.irali »

Hi,

This is just to let you know that I was facing issue with the VMWARE sdk installation and I chose to install the sdk version 6.5, and that fixed my python issue, but the sdk remains same.

For now, I dont see Return code of 127 is out of bounds. error any more.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Return code of 127 is out of bounds.

Post by vtrac »

Hi,
Hope you are having a good day!!
The "check_ncpa.py" is located under "/usr/local/nagios/libexec" folder.

To run the "check_ncpa.py":

Code: Select all

cd /usr/local/nagios/libexec

./check_ncpa.py -H 10.30.3.150 -t 'Nagios' -P 5693 -M cpu/percent -w '80' -c '90' -q 'aggregate=avg'
Or you can specify the whole path:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 10.30.3.150 -t 'Nagios' -P 5693 -M cpu/percent -w '80' -c '90' -q 'aggregate=avg'
Best Regards,
Vinh
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: Return code of 127 is out of bounds.

Post by sneha.irali »

yes its located under /usr/local/nagios/libexec and absolutely working fine.
Locked