Check HTTP issue

From the command line, this works:
./check_http -H 192.168.9.237 -u “/cognos8/gateway/cognosisapi.dll?b_action=xts.run&m=portal/main.xts&startwel=yes” -s “credential”

From WINDOWS.CFG, this does NOT work:
check_command check_http!-u “/cognos8/gateway/cognosisapi.dll?b_action=xts.run&m=portal/main.xts&startwel=yes” -s “credential” -t 5

Any idea why this works from CLI but not a CFG file?

Thanks!

you should define a my_check_http command like this:
define command{
command_name my_check_http
command_line nagios-dir/libexec/check_http -H “$ARG1$” -t 5 “$ARG2$” “$ARG3$” “$ARG4$” “$ARG5$”
}

and then, define your service as:

check_command my_check_http!192.168.9.237!-u!/cognos8/gateway/cognosisapi.dll?b_action=xts.run&m=portal/main.xts&startwel=yes!-s!credential

ps: I quickly wrote these lines, so they may not work directly; adjust them if need be :slight_smile:

Loose, with some adjustments (no quotes needed in command definition), it now seems to be working well.

Thank you! !lol

Spoke too soon. Still having an issue, using the new command definition. Getting a “bad request” warning now, so it may be with how the URL is getting passed, what with the “&” and all.

I’m getting a “Return code of 127 is out of bounds - plugin may be missing” error when trying to use the custom command. The custom command should be in commands.cfg, right?

Any ideas?

Thanks!

Solved it! Had to use double quotes around the URL to check, as there were control characters in the string.

Monitoring and reporting as desired. Thanks for the help!