For this tutorial I assume you've installed Nagios. I suggest you install Nagios using the script from
http://systemadministratorrecipes.blogspot.com/2012/06/scripts-nagios-for-install-on-ubuntu.html
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"
- Open "bash-Konsole", and type "sudo su" without quotes, then press Enter key.
- Type the administrator password.
- Type "cd /usr/local/nagios/libexec" without quotes, and press Enter key.
- Type "dir" without quotes, then press Enter key
Step 2
Let's copy the plugins installed in "/ usr / lib / nagios / plugings" to "/ usr / local / nagios / libexec"
- In the open "bash-Konsole", type "mv /usr/lib/nagios/plugins/* /usr/local/nagios/libexec" without quotes, then press Enter key.
- Type "sudo /etc/init.d/nagios restart" without quotes, then press Enter key.
After that, Nagios start working properly ;)
Thanks great tip, helped me get it working
ReplyDeleteJames
Worked like a charm!
ReplyDeleteDoesn'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?
ReplyDeleteThen the plugins was not properly installed. I suggest you go to the link "http://systemadministratorrecipes.blogspot.com/2012/06/scripts-nagios-for-install-on-ubuntu.html" and run the script for reinstall Nagios...
DeleteWe 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..?
ReplyDeleteCheck if your are missing some SNMP packages:
Deletenet-snmp-libs-x.x.x
net-snmp-x.x.x
net-snmp-utils-x.x.x
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:
net-snmp-libs-5.5-37.el6_2.1.i686
net-snmp-5.5-37.el6_2.1.i686
net-snmp-utils-5.5-37.el6_2.1.i686
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
make install
service nagios start
:-)
thanks, works for me!!!!
ReplyDeleteHello 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.
ReplyDeletemade my weekend! thank you big time
ReplyDelete