Page 1 of 1

remote execution - "no such file or directory"

Posted: Thu Feb 15, 2018 12:57 pm
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?

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

Posted: Thu Feb 15, 2018 5:19 pm
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?

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

Posted: Sun Feb 18, 2018 11:58 am
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.

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

Posted: Mon Feb 19, 2018 11:50 am
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.

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

Posted: Mon Feb 19, 2018 2:56 pm
by tmcdonald
Ahh, that would do it!

Are we all good to lock this up?