Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Hello all, I am trying to use -u and -s with the default check_http set up and it results in "Return code of 127 is out of bounds - plugin may be missing."
define service{
host_name HVACs
service_description Unit01 Comp 1 Hot Gas Temperature
check_command check_http!-u /hvac_temp/index.php?mode=fetch\&hvac=1\&probe=1 -s "Unit01 Hot Gas Bypass (Compressor 1) = OK"
max_check_attempts 3
}
I know I can just add a custom http command like $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$ -s $ARG2$ but I'd rather not create a new custom command every time I need to do something like this. Is what I am trying to do possible? Thanks!
Last edited by tay9000 on Thu Nov 22, 2012 5:28 am, edited 2 times in total.
Have you tried running the command from the command line? That will go a long way to helping diagnose what and where the problem is... it should also give you a more informative error message.
define service{
host_name HVACs
service_description Unit01 Comp 1 Hot Gas Temperature
check_command check_hvac!/hvac_temp/index.php?mode=fetch\&hvac=1\&probe=1!"Unit01 Hot Gas Bypass (Compressor 1) = OK"
max_check_attempts 3
}
However, if I just use $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$ and check_hvac!/hvac_temp/index.php?mode=fetch\&hvac=1\&probe=1 it works fine hmm....
have you installed the main plugin for nagios?
Look at /usr/local/nagios/libexec
is it empty?
If it is you have to install the main plugin: look at this thread if you need to install it... I've posted an howto guide to install them with nagios core.
Yes, everything is installed. I have many probes set up for ping, basic http, smtp, etc. I am just having issues in this specific situation.
Here is my ls output of the folder. However, I use FreeBSD so the lib folder is in a different location. My $USER1$ macro is also correctly set to $USER1$=/usr/local/libexec/nagios.
Hmmmm what an interesting problem, just out of curiousity if you were to create the command definition entirely hard coded (excluding hostaddress) do you have the same issue?
check_http is prone to having little issues. It also might be worth while putting the string to match in single quotes instead of double quotes, in case it's interpreting those brackets or something weird (I don't see why it would... but it won't make things worse to try it).
I thought it was pretty interesting too. And annoying. Single or double quotes do not make any difference. The problem is actually worse than I thought. I basically cannot use more than 1 argument with the check_http command. I think I've tried all the combinations I can. I could try installing a new check_http plugin but I am just going to set up Nagios on a CentOS server and see if I fair better with that.
This has been resolved. It turns out the ampersands need to be double escaped when used in the configuration like in the example below. Now I feel kind of silly because I have a FreeBSD and CentOS Nagios server now....