[hobbit] apache perf monitoring leaves http test purple

Henrik Stoerner henrik at hswn.dk
Sat Apr 30 17:55:54 CEST 2005


On Sat, Apr 30, 2005 at 12:32:47AM +0200, Henrik Stoerner wrote:
> On Fri, Apr 29, 2005 at 03:48:33PM -0400, Tom Georgoulias wrote:
> > I set up Apache performance monitoring today and it's pretty cool. 
> > apache.rrd is filling up with data, graphs are working fine and 
> > displaying in my trends page, yada yada yaday.  I did run into a problem 
> > though, my http column remains purple even though I didn't configure 
> > Hobbit to monitor a specific url.
> 
> Could be a bug ... I hadn't thought that you would want to collect
> performance data from a webserver, without monitoring that it was actually
> running.

Confirmed ... an "apache" test with no "http" tests for the same host
ends up sending a completely bogus http status message to Hobbit.

The attached patch fixes it, and I'll include this in the next release
(real soon now - promise!)


Henrik

-------------- next part --------------
--- bbnet/httpresult.c	2005/04/25 12:39:51	1.13
+++ bbnet/httpresult.c	2005/04/30 15:47:56
@@ -10,7 +10,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: httpresult.c,v 1.13 2005/04/25 12:39:51 henrik Exp $";
+static char rcsid[] = "$Id: httpresult.c,v 1.14 2005/04/30 15:52:35 henrik Exp $";
 
 #include <sys/types.h>
 #include <stdlib.h>
@@ -81,7 +81,7 @@
 	char	msgtext[MAXMSG];
 	char    *nopagename;
 	int     nopage = 0;
-	int	anydown = 0;
+	int	anydown = 0, totalreports = 0;
 
 	if (firsttest == NULL) return;
 
@@ -102,6 +102,7 @@
 		/* Skip the data-reports for now */
 		if (t->senddata) continue;
 
+		totalreports++;
 		req->httpcolor = statuscolor(host, req->httpstatus);
 		if (req->httpcolor == COL_RED) anydown++;
 
@@ -186,6 +187,12 @@
 		}
 	}
 
+	/* It could be that we have 0 http tests - if we only do the apache one */
+	if (totalreports == 0) {
+		xfree(svcname);
+		return;
+	}
+
 	if (anydown) {
 		firsttest->downcount++; 
 		if(firsttest->downcount == 1) firsttest->downstart = time(NULL);


More information about the Xymon mailing list