Return code 127 for plugins after CentOS update

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.
Locked
seankelly
Posts: 3
Joined: Thu Apr 08, 2021 7:48 am

Return code 127 for plugins after CentOS update

Post by seankelly »

Hopefully someone here can help me with this problem. I can't post to the customer support area because our purchasing department is dragging their feet on purchasing XI.

The problem is, after doing a yum update on our CentOS Stream machine that is running our Nagios software, none of my service checks work in Nagios XI. It's a manual install of Nagios, we aren't using a VM. The service checks all use check_xi_ncpa to check various things such as specific services running and CPU/Mem usage. Since the update all attempts to check any service has an error of (Return code of 127 is out of bounds. Check if plugin exists). Host checks seem to be fine. I'm guessing it's a Python related issue since the check_ncpa plugin is a python script and Python was updated with the big yum update this morning. Current version of Python is 3.6.8.

I've checked the resources.cfg and the $USER1$ is still pointing to the correct directory and check_ncpa.py is still there in the libexec directory. I'm not sure what else to check at this point. I'm debating on trying to do a yum history undo on the update for this morning and see if that fixes the problem.

Thanks for any help you can give.
seankelly
Posts: 3
Joined: Thu Apr 08, 2021 7:48 am

Re: Return code 127 for plugins after CentOS update

Post by seankelly »

This is the output of the history file for the update that occurred just before the service checks stopped working. Also I forgot to mention that service checks for the local machine (check_local) are working and are the only service checks working.


The output was too long for these forums, so I had to dump it on pastebin: https://pastebin.com/Sbg4Ztti
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Return code 127 for plugins after CentOS update

Post by gormank »

I don't use it but I seem to recall the the interpreter is named python3 rather than python. I'd probably run whatever script the check_xi_ncpa command runs and see what it says.
seankelly
Posts: 3
Joined: Thu Apr 08, 2021 7:48 am

Re: Return code 127 for plugins after CentOS update

Post by seankelly »

Yes, that was the problem. We only had Python3 before as well but something in the update made the system stop recognizing python as python3 I guess.

Anyway to fix the problem, I went to usr/local/nagios/libexec and edited the check_ncpa.py file. The first line in it was /usr/bin/env python. I added a 3 to the end of Python and now all of the service checks are working again.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Return code 127 for plugins after CentOS update

Post by benjaminsmith »

Hi Sean,
The first line in it was /usr/bin/env python. I added a 3 to the end of Python and now all of the service checks are working again.
Good news. Thanks for posting the solution.

We'll go ahead and mark this as resolved.
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