http_check cli vs cfg-files?

Hi! I get the following command to work in CLI.

When I have the correct user/pass I get a redirect (302) and when I don’t I just get OK (200).

When I try to do this i cfg-files I just get 302, no matter what. See below.

[code]define host{
use generic-host
host_name Page1
alias Page2
address this.site.com
}

define service{
use generic-service
host_name Page1
service_description HTTPxx
check_command check_http!-H this.site.com -u “/login.aspx?loginName=user1&passWord=pass1"
[/code]
I’ve also tested this with this check_command

And also with and without ip (-I). I know I do something wrong, can you people help me out?

try " instead of "

Tested - nope.

I also tested to replace this.site.com to something really bogus and still get 302s. So something else is wrong here. In CLI I get “Cannot open socket”.

if you still get a 302 you are problaby running the command with fixed parameters instead of using the service defintion parameters. cehck the command definition.

Wow!

Excellent support guys!

This one works!

[code]efine host{
use generic-host
host_name Page1
alias Page2
address this.site.com
}

define command{
command_name check_http_spec
command_line /usr/lib/nagios/plugins/check_http -H this.site.com -u “/login.aspx?loginName=user1&passWord=pass1"” -e 302
}

define service{
use generic-service
host_name Page1
service_description HTTPxx
check_command check_http_spec
}[/code]
Next step is learn to use arguments so I can reuse that command!

Thanks again both of you!

uhm… both? :mrgreen:

nagios.sourceforge.net/docs/3_0/macros.html
example2 is what you are looking for :wink:

You, because you tried to help me within like 3 minutes time :smiley: Hehe

Tell your boss to check my signature… haha :slight_smile: