Nagios Plugin Error: (No output on stdout) ... failed. errno is 2: No such file or directory

Matt Hahn picture Matt Hahn · Jul 13, 2016 · Viewed 13.2k times · Source

I am using custom Nagios plugins for the first time and am running into this error when I create a service for the plugin.

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load.py, ...) failed. errno is 2: No such file or directory

The plugin works when I run it on the command line, however does not work when it runs within Nagios.

I followed these steps to get the plugin into Nagios https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI.pdf

Here is what it looks like in the Nagios UI

The plugin is in the correct path: /usr/local/nagios/libexec and the resource.cfg file has the same path within it.

I tried two separate plugins, both which work on the command line, and the result is the same error.

The error indicates the file location is incorrect, however the plugin is in the specified directory and runs with no errors within that directory.

I am totally stumped and appreciate any help.

Answer

Matt Hahn picture Matt Hahn · Jul 20, 2016

For anyone reading this, I solved the problem.

The first time I added the plugin, I forgot to add the python extension. When I updated the already created plugin, Nagios still threw the error.

Once I completely deleted the plugin and re-created it the 'file not found', error went away.