Since the front page of a web server I wish to check is rather large (49k), I created a very tiny web page for nagios testing purposes. In services.cfg I changed the check option to:
check_http!–url=/nagios.html
But it looks like it’s still pulling down the default web page as the size is still the same. Am I missing something? Yes, I restarted nagios. I also tried using the alternate switch of “-u /nagios.html”.
as Gus said, you need to redefine the checkcommand.
if check_http is defined as
command_line $USER1$/check_http -H $HOSTADDRESS$
(which most probably is your case if you didn’t modify it)
nagios will ignore any parameters you provide in the service definition and only check http on the IP provided in the host definition.
There doesn’t seem to be a way to pass optional parameters to a check command, right? This could easily be solved if there was an $ARG$ macro that returns the entire command line, like using ‘$USER1$…$USER32$’. Then all of the check commands could be modified to include that by default.
most check_commands have options. Those options have to be defined in the checkcommands.cfg file before you run the script. i.e. -a $ARG1 -c …etc, there is no way to define before hand (by default as you put it) what switch options are in any particular check_command. Does check_ping use a -c or a -a or a -b? It’s just not possible to know unless all scripts included options a-z by default or all scripts use options a-k. But what if some script has no need for that many options.
A better solution is to run ./check_command --help and read the output. Then test the script by command line and then define the command in checkcommands.cfg with ONLY the options and ARGS that you feel the need to use.