[Check_mk (english)] 1.2.7i3p3 HTTP Active Check bug

I noticed this in 1.2.7i3p2 as well but it looks like the HTTP Active check may have gotten broken with the addition of IPv6 support in werk #2674.

The output of the check is listed as "Name or service not known," looking at the service check command, the variable $HOST_ADDRESS_4$ doesn't seem to be defined in Nagios
check_mk_active-http! -I $HOST_ADDRESS_4$ -w 0.600000 -c 0.800000 -t 5 -e '404'

Looking at the host definition in the generated Nagios config I see that hosts now have a custom variable _ADDRESS_4 defined but according to this Nagios doc:
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/customobjectvars.html

_HOST gets prepended and the leading underscore in the config file gets removed.

I modified /usr/share/check_mk/checks/check_http around line 51 to read:
    if address_family == "ipv6":
        args += " -6"
        address = "$_HOSTADDRESS_6$"
    else:
        address = "$_HOSTADDRESS_4$"

rather than the original
    if address_family == "ipv6":
        args += " -6"
        address = "$HOST_ADDRESS_6$"
    else:
        address = "$HOST_ADDRESS_4$"

And now my active HTTP checks work again!

Hi Nick,

Lars fixed this in git master yesterday: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=846a34fdd4ea8f885cb04c10c2b76f2044e6ba4d

Apparently something went wrong with the commit message, here’s the fix in 1.2.7i3 branch: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11e84380e8bb3d93f9aec4c3ee290a15df6ec129

Regards,

Marcel

···

Nick Erkert NICK.ERKERT@procirrus.com schrieb am So., 25. Okt. 2015 um 18:17 Uhr:

I noticed this in 1.2.7i3p2 as well but it looks like the HTTP Active check may have gotten broken with the addition of IPv6 support in werk #2674.

The output of the check is listed as “Name or service not known,” looking at the service check command, the variable $HOST_ADDRESS_4$ doesn’t seem to be defined in Nagios

check_mk_active-http! -I $HOST_ADDRESS_4$ -w 0.600000 -c 0.800000 -t 5 -e ‘404’

Looking at the host definition in the generated Nagios config I see that hosts now have a custom variable _ADDRESS_4 defined but according to this Nagios doc:

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/customobjectvars.html

_HOST gets prepended and the leading underscore in the config file gets removed.

I modified /usr/share/check_mk/checks/check_http around line 51 to read:

if address_family == "ipv6":

    args += " -6"

    address = "$_HOSTADDRESS_6$"

else:

    address = "$_HOSTADDRESS_4$"

rather than the original

if address_family == "ipv6":

    args += " -6"

    address = "$HOST_ADDRESS_6$"

else:

    address = "$HOST_ADDRESS_4$"

And now my active HTTP checks work again!


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en