[Nagiosplug-devel] check_http -c incorrect status information

Monty Solomon monty at roscom.com
Tue Oct 16 09:10:50 CEST 2007


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);





More information about the Devel mailing list