This is the most common errors that you can have with nagios, testing some new checks. Here are some solutions for that:

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

Problem:

You are missing a file/ file is in another path / syntax error in config

Solution:

  • Checks that Nagios plugins are installed correctly in the "$USER1$" path. (it should be defined in /etc/nagios/resource.cfg)
  • Verify syntax in plugin config file (look in here --> /etc/nagios-plugins/config/)

Service check did not exit properly

Problem:

Your new check is working from the console, but after you run it in nagios you et the folowing error.

Solution:

Its a problem with embedded perl in nagios. Edit your check config file and define you system perl binary to describe nagios command, like this:

define command{ 
       command_name my_check 
       command_line /usr/bin/perl /usr/lib/nagios/plugins/my/my_check.pl ... 
}