[Check_mk (english)] check_http and -d option / expressions possible?

Hi,

I'm trying to configure a check_http service with the option -d String to expect in header.
If I use a "fixed" string like Location: https://<url>/test all is working as expected.

So I tried to use it in a ruleset with $_HOSTADDRESS_4$ but this doesn't work but I need
to generalize this rule (because I have hundred of hosts...).

Are regex support in WATO's field "String to expect in response header"?

Thx!

Regards
Guenther

Update: It seems that $_HOSTADDRESS_4$ is translated to the right value, but I still get
an
HTTP CRITICAL: HTTP/1.1 302 - header 'Location: <...> not found on <...>' - 782 bytes in 0.193 second response time

The first location url is in format https://<url>...%27 <-- that's strange, why "...%27"?

How can I debug this in detail? on the cli it's working fine at all (but I cannot check the $_HOSTADDRESS_4$ substitution

Thx!

Regards
Guenther

···

Gesendet: Samstag, 16. November 2019 um 10:25 Uhr
Von: guenther.rasch@gmx.at
An: checkmk-en@lists.mathias-kettner.de
Betreff: check_http and -d option / expressions possible?
Hi,

I'm trying to configure a check_http service with the option -d String to expect in header.
If I use a "fixed" string like Location: https://<url>/test all is working as expected.

So I tried to use it in a ruleset with $_HOSTADDRESS_4$ but this doesn't work but I need
to generalize this rule (because I have hundred of hosts...).

Are regex support in WATO's field "String to expect in response header"?

Thx!

Regards
Guenther

Hallo,
using a tag is no solution?

Ralf

···

Von meinem iPad gesendet

Am 16.11.2019 um 10:26 schrieb guenther.rasch@gmx.at:

Hi,

I'm trying to configure a check_http service with the option -d String to expect in header.
If I use a "fixed" string like Location: https://<url>/test all is working as expected.

So I tried to use it in a ruleset with $_HOSTADDRESS_4$ but this doesn't work but I need
to generalize this rule (because I have hundred of hosts...).

Are regex support in WATO's field "String to expect in response header"?

Thx!

Regards
Guenther
_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
Manage your subscription or unsubscribe
https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-en

Hi Ralf,

don't understand how a tag can help? I need an option to verify if the Location-string
in the header is set to the right URL. To generalize this option I try to use the
$_HOSTADDRESS_4$. The variable is tranlated but the output / result is still critical.
Do you know how I can get more detailed output because "https://<part-of-the-url>...%27"
is all I can see. <part-of-the-url> is right thats why I thought the variable is
translated.

Regards
Guenther

···

Gesendet: Samstag, 16. November 2019 um 12:38 Uhr
Von: "Ralf Prengel" <ralf.prengel@rprengel.de>
An: guenther.rasch@gmx.at
Cc: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] check_http and -d option / expressions possible?

Hallo,
using a tag is no solution?

Ralf

Von meinem iPad gesendet

> Am 16.11.2019 um 10:26 schrieb guenther.rasch@gmx.at:
>
> Hi,
>
> I'm trying to configure a check_http service with the option -d String to expect in header.
> If I use a "fixed" string like Location: https://<url>/test all is working as expected.
>
> So I tried to use it in a ruleset with $_HOSTADDRESS_4$ but this doesn't work but I need
> to generalize this rule (because I have hundred of hosts...).
>
> Are regex support in WATO's field "String to expect in response header"?
>
> Thx!
>
> Regards
> Guenther
> _______________________________________________
> checkmk-en mailing list
> checkmk-en@lists.mathias-kettner.de
> Manage your subscription or unsubscribe
> https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-en

Very strange behaviour. Done the call at the command line with the -d '/main/main.do'
Verified it on the check-mk-service description page:
'-d' '/main/main.do' '-j' 'GET' '-H' '$_HOSTADDRESS_4$' '--sni' '$_HOSTADDRESS_4$'

The options are the same as at the commandline; but the result check is
HTTP CRITICAL: HTTP/1.1 302 - header '/main/main.do' not found on ....

But on the commandline it works fine (as I said, same call).

Any ideas?

Regards
Guenther

···

Gesendet: Samstag, 16. November 2019 um 12:38 Uhr
Von: "Ralf Prengel" <ralf.prengel@rprengel.de>
An: guenther.rasch@gmx.at
Cc: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] check_http and -d option / expressions possible?

Hallo,
using a tag is no solution?

Ralf

Von meinem iPad gesendet

> Am 16.11.2019 um 10:26 schrieb guenther.rasch@gmx.at:
>
> Hi,
>
> I'm trying to configure a check_http service with the option -d String to expect in header.
> If I use a "fixed" string like Location: https://<url>/test all is working as expected.
>
> So I tried to use it in a ruleset with $_HOSTADDRESS_4$ but this doesn't work but I need
> to generalize this rule (because I have hundred of hosts...).
>
> Are regex support in WATO's field "String to expect in response header"?
>
> Thx!
>
> Regards
> Guenther
> _______________________________________________
> checkmk-en mailing list
> checkmk-en@lists.mathias-kettner.de
> Manage your subscription or unsubscribe
> https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-en