remote execution - "no such file or directory"

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
DMKatIBM
Posts: 22
Joined: Thu Jan 11, 2018 3:41 pm

remote execution - "no such file or directory"

Post by DMKatIBM »

I am using the identical plugin (reached via ssh) on two systems. On one, it works fine. On the other, the UI is showing error code 127 - no such file or directory.

Here is the one that is failing:

Feb 15 11:38:22 dal10-build-Nagios nagios: SERVICE ALERT: server-XYZ;Check event ingestion;CRITICAL;SOFT;1;(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: bash: /opt/devmgmt/libexec/ingestion_check.py: No such file or directory))
Feb 15 11:40:23 dal10-build-Nagios nagios: Warning: Return code of 127 for check of service 'Check event ingestion' on host 'server-XYZ' was out of bounds. Make sure the plugin you're trying to run actually exists.

But it's there, and I can run it manually, remotely:

[root@dal10-build-Nagios libexec]# ssh server-XYZ /opt/devmgmt/libexec/ingestion_check.py
Pipeline successfully processing events
[root@dal10-build-Nagios libexec]#

Permissions are 755 on the file:

[root@dal10-build-Nagios libexec]# ssh server-XYZ "ls -l /opt/devmgmt/libexec/ingestion_check.py"
-rwxr-xr-x 1 root root 1409 Feb 15 12:32 /opt/devmgmt/libexec/ingestion_check.py
[root@dal10-build-Nagios libexec]#

What's going on?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: remote execution - "no such file or directory"

Post by npolovenko »

Hello, @DMKatIBM. Can you show us the command that Nagios server is using and the service check definition?
On the remote server please run:

Code: Select all

chmod a+x /opt/devmgmt/libexec/ingestion_check.py
Does that fix the issue?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
DMKatIBM
Posts: 22
Joined: Thu Jan 11, 2018 3:41 pm

Re: remote execution - "no such file or directory"

Post by DMKatIBM »

It already has world execute permission (755) and runs returns the correct exit code from the other system. The same file is in use with the same permissions on both systems. One works, the other doesn't.
DMKatIBM
Posts: 22
Joined: Thu Jan 11, 2018 3:41 pm

Re: remote execution - "no such file or directory"

Post by DMKatIBM »

Found the problem.

The system that is failing the checks was previously migrated to a new host. The /etc/hosts file reflected the updated system (which is why I could run it manually, successfully) but the old host IP was still listed in hosts.cfg, so it couldn't find the command because it was going to the host that didn't have the plugin on it.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: remote execution - "no such file or directory"

Post by tmcdonald »

Ahh, that would do it!

Are we all good to lock this up?
Former Nagios employee
Locked