Check_xi_service_http Response Status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Check_xi_service_http Response Status

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Check_xi_service_http Response Status

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked