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

15,003

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.

Share:
15,003
Matt Hahn
Author by

Matt Hahn

Software Engineer @ Amazon. Queen's University Sci 17

Updated on June 04, 2022

Comments

  • Matt Hahn
    Matt Hahn about 2 years

    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.

  • Thomas Vander Stichele
    Thomas Vander Stichele over 7 years
    Please clarify what "forgot to add the python extension" means?
  • frei
    frei over 7 years
    seconded the above comment
  • Matt Hahn
    Matt Hahn about 7 years
    "forgot to add the python extension" refers to the file extension (.py). For example, I initially added the plugin with "filename" instead of "filename.py"