Return code 127 plugin doesn't exist after Linux OS upgrade

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.
Post Reply
romanoarnaldi
Posts: 7
Joined: Wed Feb 16, 2022 5:48 am

Return code 127 plugin doesn't exist after Linux OS upgrade

Post by romanoarnaldi »

Hello All,

I have just upgraded from AlamLinux 8.10 to AlmaLinux 9.4 and my plugins are not found anymore.

Any idea what I need to do to fix?

[1726216889] Nagios 4.5.2 starting... (PID=1046)
[1726216889] Local time is Fri Sep 13 10:41:29 CEST 2024
[1726216889] LOG VERSION: 2.0
[1726216889] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1726216889] qh: core query handler registered
[1726216889] qh: echo service query handler registered
[1726216889] qh: help for the query handler registered
[1726216889] wproc: Successfully registered manager as @wproc with query handler
[1726216889] wproc: Registry request: name=Core Worker 1049;pid=1049
[1726216889] wproc: Registry request: name=Core Worker 1050;pid=1050
[1726216889] wproc: Registry request: name=Core Worker 1048;pid=1048
[1726216889] wproc: Registry request: name=Core Worker 1047;pid=1047
[1726216889] Successfully launched command file worker with pid 1064
[1726216889] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216891] Warning: Return code of 127 for service 'HTTPS' on host 'xxxx' may indicate this plugin doesn't exist.
[1726216892] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216893] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216893] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216898] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216899] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216902] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216903] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.
[1726216908] Warning: Return code of 127 for host 'xxxx' may indicate this plugin doesn't exist.

Thanks everyody!
R
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Return code 127 plugin doesn't exist after Linux OS upgrade

Post by bbahn »

Hello @romanoarnaldi,

Your plugins will be located on your Nagios Core server at /usr/local/nagios/libexec. You can check this folder to see your plugins. I would verify that your plugin exists at that location and that you are able to execute it from the command line. You can check the command that Nagios is using in your commands, where the call to the plugin will be defined and you can use that to test your plugin in the same method that Core is using when it tries to run your plugin.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
romanoarnaldi
Posts: 7
Joined: Wed Feb 16, 2022 5:48 am

Re: Return code 127 plugin doesn't exist after Linux OS upgrade

Post by romanoarnaldi »

Hi thanks for your help.

Plugins are there and I can run them manually but some give me errors like:

- Can't locate List/Compare.pm in @INC (you may need to install the List::Compare module)

- /usr/bin/python2: bad interpreter: No such file or directory

- error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

It seems I have to fix all errors oneby one.

I saw a post about fixing python, I'll see about the others..
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Return code 127 plugin doesn't exist after Linux OS upgrade

Post by bbahn »

Hello @romanoarnaldi,

It seems that you are likely running into the issue of all your plugins being Python 2 plugins, but Almalinux 9 only supports Python 3. Python 2 and 3 are not compatible and you will need new plugins on Almalinux 9. How did you do your install/upgrade/migration?
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
romanoarnaldi
Posts: 7
Joined: Wed Feb 16, 2022 5:48 am

Re: Return code 127 plugin doesn't exist after Linux OS upgrade

Post by romanoarnaldi »

Hello bbahn,

Thank you very much indeed for taking time to look into my issue!

The problem is not really related only to python, please see below different error examples, including perl, running commands at the terminal:

[root@nagios ~]# /usr/local/nagios/libexec/check_sample1.pl -H xxxxxxxxx
Can't locate List/Compare.pm in @INC (you may need to install the List::Compare module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/local/nagios/libexec/check_sample1.pl line 129.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_sample1.pl line 129.

[root@nagios ~]# /usr/local/nagios/libexec/check_sample2.py -H xxxxxxxxx
-bash: /usr/local/nagios/libexec/check_sbc.py: /usr/bin/python2: bad interpreter: No such file or directory

[root@nagios ~]# /usr/local/nagios/libexec/check_sample3 -H xxxxxxxxx
/usr/local/nagios/libexec/check_nt: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory


The migration went successfully from CentOS Stream 8 to AlmaLinux 8.10, Nagios was OK at that point, but then upgrading from AlmaLinux 8.10 to AlmaLinux 9.4 broke something.

Thankfully I have both VM snapshots, before and after the last AlmaLinux upgrade, therefore I'm now back onto AlmaLinux 8.10, but would like to give it another try or fix the issues if possible...

The AlmaLinux upgrade was done following this link
https://wiki.almalinux.org/elevate/ELev ... guide.html

Thank you!
romanoarnaldi
Posts: 7
Joined: Wed Feb 16, 2022 5:48 am

Re: Return code 127 plugin doesn't exist after Linux OS upgrade

Post by romanoarnaldi »

... and you are right bbahn,

Just pointing to Python3 wouldn't be enough to fix "*.py" scripts: they fail with syntax errors, therefore I would need also new/amended pluguins.

Thanks!

R
Post Reply