[Nagiosplug-devel] check_http -c incorrect status information

Thomas Guyot-Sionnest Thomas at zango.com
Wed Oct 17 17:59:14 CEST 2007


> -----Original Message-----
> From: nagiosplug-devel-bounces at lists.sourceforge.net
[mailto:nagiosplug-
> devel-bounces at lists.sourceforge.net] On Behalf Of Monty Solomon
> Sent: Tuesday, October 16, 2007 0:11
> To: nagiosplug-devel at lists.sourceforge.net
> Subject: [Nagiosplug-devel] check_http -c incorrect status information
> 
> 
> The check_http plugin does not display the correct status information
> when using the -c option.
> 
> The following code will always display "HTTP WARNING:" in the status
> information for any condition which would have a status of warning or
> critical because it builds the status message with the hard coded
> "WARNING" text before determining the actual status.
> 
> 
>   /* check elapsed time */
>   microsec = deltime (tv);
>   elapsed_time = (double)microsec / 1.0e6;
>   asprintf (&msg,
>             _("HTTP WARNING: %s - %.3f second response time %s|%s
%s\n"),
>             status_line, elapsed_time,
>             (display_html ? "</A>" : ""),
>             perfd_time (elapsed_time), perfd_size (pagesize));
>   if (check_critical_time == TRUE && elapsed_time > critical_time)
>     die (STATE_CRITICAL, "%s", msg);
>   if (check_warning_time == TRUE && elapsed_time > warning_time)
>     die (STATE_WARNING, "%s", msg);

Good catch. While testing I also noticed w- and -c are still ineffective
on 302 redirects (I sent a hacky fix long time ago but a proper fix
would take more work)... 

I guess it's time to get my hands dirty and fix this for good :)

Thomas




More information about the Devel mailing list