Page 1 of 1

NCPA Plugin Return Code of 127

Posted: Thu Aug 08, 2019 8:51 pm
by ehln
Hello,

I'm getting an error of "Return code of 127 is out of bounds. Check if plugin exists" when trying to check services with NCPA. I've uninstalled the plugin and reinstalled the plugin; still getting the same error. I've verified that there is data within the check_ncpa.py file. The permissions match the rest of the plugins. I'm running the VMware image of XI version 5.6.5. I've ran a couple discovery commands from other threads and have listed the output below.

Code: Select all

[root@***edit***NAGIOS libexec]#
[root@***edit***NAGIOS libexec]# ./check_ncpa.py -H ***edited*** -t '***edited***' -P  -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
: No such file or directory
[root@***edit***NAGIOS libexec]#

Code: Select all

[root@***edit***NAGIOS libexec]# ./check_ncpa.py
: No such file or directory
[root@***edit***NAGIOS libexec]#

Code: Select all

[root@***edit***NAGIOS libexec]# file check_ncpa.py
check_ncpa.py: a /usr/bin/env python\015 script text executable
[root@***edit***NAGIOS libexec]#

Code: Select all

[root@***edit***NAGIOS libexec]# ls -la ./check_ncpa.py
-rwxrwxr-x 1 apache nagios 10567 Aug  7 16:15 ./check_ncpa.py
[root@***edit***NAGIOS libexec]#

Re: NCPA Plugin Return Code of 127

Posted: Fri Aug 09, 2019 9:09 am
by lmiltchev
I would check first if lind endings are set to "unix" in the script. Make sure they are not set to "dos". Open the plugin in "vi" editor, type:

Code: Select all

:set ff=unix
and hit "Enter". Save and exit by typing:

Code: Select all

:wq
and hitting "Enter" again. Test your plugin again.

If this doesn't work, run the following commands, and show the output:

Code: Select all

which python
python --version
env | grep -i python
which env
ls -al /usr/bin/env

Re: NCPA Plugin Return Code of 127

Posted: Fri Aug 09, 2019 5:17 pm
by ehln
That fixed it. The plugin is now working.

Code: Select all

:set ff=unix
Thank you!

Re: NCPA Plugin Return Code of 127

Posted: Mon Aug 12, 2019 9:38 am
by mbellerue
Excellent, glad to hear it's working! Closing thread.