NCPA Plugin Return Code of 127

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ehln
Posts: 5
Joined: Fri Aug 02, 2019 4:36 pm

NCPA Plugin Return Code of 127

Post 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]#
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA Plugin Return Code of 127

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
ehln
Posts: 5
Joined: Fri Aug 02, 2019 4:36 pm

Re: NCPA Plugin Return Code of 127

Post by ehln »

That fixed it. The plugin is now working.

Code: Select all

:set ff=unix
Thank you!
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: NCPA Plugin Return Code of 127

Post by mbellerue »

Excellent, glad to hear it's working! Closing thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked