Page 1 of 1

Return code 127 for plugins after CentOS update

Posted: Fri Jun 04, 2021 11:12 am
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.

Re: Return code 127 for plugins after CentOS update

Posted: Fri Jun 04, 2021 1:50 pm
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

Re: Return code 127 for plugins after CentOS update

Posted: Fri Jun 04, 2021 3:45 pm
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.

Re: Return code 127 for plugins after CentOS update

Posted: Tue Jun 08, 2021 9:38 am
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.

Re: Return code 127 for plugins after CentOS update

Posted: Tue Jun 08, 2021 10:21 am
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.