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 ;)