Page 1 of 1

Check_xi_service_http Response Status

Posted: Mon Feb 08, 2021 1:52 pm
by meganwilliford
Is it possible to return a Warning status instead of the default Critical status when the response does not = 200 for the below service check?

check command: check_xi_service_http
$ARG1$: -f ok -H examplehost -u '/login' -S --sni -p 443

Re: Check_xi_service_http Response Status

Posted: Tue Feb 09, 2021 3:45 pm
by benjaminsmith
Hi Megan,

That check command is using the check_http plugin, and here's how it handles the different conditions and state types.
This plugin will attempt to open an HTTP connection with the host.
Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL
other errors return STATE_UNKNOWN. Successful connects, but incorrect response
messages from the host result in STATE_WARNING return values.
See: The check_http Plugin

That behavior cannto be changed without altering the plugin, however, you can use the negate plugin to change the output from warning to critical.

See: Using The Negate Plugin

So for example:

Code: Select all

/usr/local/nagios/libexec/negate -w CRITICAL  -s /usr/local/nagios/libexec/check_http -f ok -H examplehost.com -u '/login' -S --sni -p 443
Let me know if that would work for you.

Best Regards,
Benjamin