Wednesday, January 23, 2013

Nagios "Return Code of 127 is out of bounds - plugin may be missing"

For this tutorial I assume you've installed Nagios. I suggest you install Nagios using the script from 

After installing Nagios. Start it and you will receive the following error:

 "Return code of 127 is out of bounds - plugin may be missing"

 To fix this error follow these instructions:

Step 1 

Checks that Nagios plugins are installed correctly in the "libexec"
  1. Open "bash-Konsole", and type "sudo su" without quotes, then press Enter key.
  2. Type the administrator password.
  3. Type "cd /usr/local/nagios/libexec" without quotes, and press Enter key.
  4. Type "dir" without quotes, then press Enter key 
 This command should show you Nagios plugins installed. If the folder is empty performs Step 2

Step 2

Let's copy the plugins installed in "/ usr / lib / nagios / plugings" to "/ usr / local / nagios / libexec"
  1. In the open "bash-Konsole", type "mv /usr/lib/nagios/plugins/* /usr/local/nagios/libexec" without quotes, then press Enter key.
  2. Type "sudo /etc/init.d/nagios restart" without quotes, then press Enter key.
Now open browser type http://localhost/nagios and log in.

After that, Nagios start working properly ;)



  1. Thanks great tip, helped me get it working


  2. Doesn't work with me! I use the ubuntu 12.04 server and Nagios Version 3.5.0. Doesn't exists the /usr/lib/nagios/plugins directory! But... in my server is /usr/local/nagios/nagios-plugins-1.4.16 ... i copied the plugins to the libexec directory... but doesn't work... any idea?

    1. Then the plugins was not properly installed. I suggest you go to the link "" and run the script for reinstall Nagios...

  3. We have Nagios installed on Centos and all our plugins are in /usr/lib/nagios/plugins dir and everything has been working fine for the past few years. Now I've added a new custom check and it works perfectly fine in command line, but gives the same error (Return Code of 127..) in GUI. We do not have /usr/local/nagios/libexec dir at all. Any suggestions..?

    1. Check if your are missing some SNMP packages:


      for that, run this command:

      rpm -qa | grep net-snmp

      If this command does nor return anything, then you need install the packages using your package manager.

      After you are done run the command "rpm -qa | grep net-snmp" again to verify that the packages are installed:


      Now you need to stop Nagios to recompile and re-install the Nagios Plug-ins

      for that, go to the folder where the plug-ins are download:

      /configure --with-nagios-user=nagios --with-nagios-group=nagios


      make install

      service nagios start


  4. Hello I installed nagios3 and nagios plugins in ubuntu by apt-get install nagios3.It is working for me but now i am going to install custom nagios plugins without nrpe.I am using only nagios server and i dont have /usr/local/nagios/libexec this directory and tell me what i have to do???? and i am getting return code of 127 plugin may be missing tell me the solution plzz.

  5. made my weekend! thank you big time