Xymon Mailing List Archive search

bbgen core dump on "empty" alternate pages

2 messages in this thread

list Kolbjørn Barmen · Tue, 30 May 2006 00:56:21 +0200 (CEST) ·
I just noticed something today...

A few weeks ago I set up an alternate view "TESTING:" where I can put hosts
that are still not in production, but that might be interesting to monitor
by the people who are setting them up. As it was I had two such hosts.

A few days ago I moved those over to PROD: which left TESTING: empty - no
hosts. This caused bb-gen to core dump every time it tried to create the
page for TESTING: - I just noticed this when playing with the report
generator and noticed that the bbgen test for the server changed between
red and green every 5 minutes or so... 

(I have not set up paging and email alerts yet - go figure ;) )

I fixed this by putting a dummy host in bb-hosts:
0.0.0.0         dummy         # TESTING: noconn noinfo notrends

However, I guess this can be fixed for 4.2 (if it isnt already) so I
thought I'd mention it. Hopefully I'm not the only one who can
reproduce this :)

-- 
Kolbjørn Barmen
UNINETT Driftsenter
list Henrik Størner · Tue, 30 May 2006 08:29:03 +0200 ·
quoted from Kolbjørn Barmen
On Tue, May 30, 2006 at 12:56:21AM +0200, Kolbjørn Barmen wrote:
I just noticed something today...

A few weeks ago I set up an alternate view "TESTING:" where I can put hosts
that are still not in production, but that might be interesting to monitor
by the people who are setting them up. As it was I had two such hosts.

A few days ago I moved those over to PROD: which left TESTING: empty - no
hosts. This caused bb-gen to core dump every time it tried to create the
page for TESTING:
I also noticed this yesterday while looking at a different bug. This
patch should fix it (goes on top of todays snapshot, but will probably
apply cleanly against all of the beta/snapshots of 4.2).


Regards,
Henrik

-------------- next part --------------
--- bbdisplay/util.c	2006/05/03 21:12:33	1.153
+++ bbdisplay/util.c	2006/05/30 06:26:12
@@ -173,6 +173,8 @@
 static RbtIterator hostlistwalk;
 hostlist_t *hostlistBegin(void)
 {
+	if (havehosttree == 0) return NULL;
• hostlistwalk = rbtBegin(hosttree);
 
 	if (hostlistwalk != rbtEnd(hosttree)) {
@@ -185,6 +187,8 @@
 
 hostlist_t *hostlistNext(void)
 {
+	if (havehosttree == 0) return NULL;
• if (hostlistwalk != rbtEnd(hosttree)) hostlistwalk = rbtNext(hosttree, hostlistwalk);
 
 	if (hostlistwalk != rbtEnd(hosttree)) {