[hobbit] A few hobbit problems

Henrik Stoerner henrik at hswn.dk
Mon Apr 4 07:49:25 CEST 2005


On Sun, Apr 03, 2005 at 06:20:53PM -0400, Schwimmer, Eric E *HS wrote:
> 
> >Could you try getting the call trace from the core file ? Assuming
> >the core file is in the current directory, you should do this:
> >
> >    $ gdb /usr/local/hobbit/server/bin/bb-eventlog.cgi core
> >    [messages from gdb]
> >    gdb> bt
> >
> >The output from the "bt" command would be very helpful in narrowing
> >down the problem.
> 
> Below is the output from gdb

Thanks, that pin-pointed the problem nicely. Your eventlog has an
entry from a host that is not in the bb-hosts file; these are ignored
by the normal eventlog shown on the bb2 page, but the CGI script tried
to include them with fatal consequences.

I've attached a patch to fix this. To apply, save the patch to
/tmp/eventlog-crash.patch, then

  cd hobbit-4.0.1
  patch -p0 </tmp/eventlog-crash.patch
  make
  make install  # as root


Regards,
Henrik
-------------- next part --------------
--- bbdisplay/pagegen.c	2005/03/22 09:03:37	1.139
+++ bbdisplay/pagegen.c	2005/04/04 05:43:53
@@ -1023,7 +1023,7 @@
 	while (p) {
 		/* Dont redo the eventlog or acklog things */
 		if (strcmp(p, "eventlog.sh") == 0) {
-			if (bb2eventlog && !havedoneeventlog) do_eventlog(output, bb2eventlogmaxcount, bb2eventlogmaxtime, 0);
+			if (bb2eventlog && !havedoneeventlog) do_eventlog(output, bb2eventlogmaxcount, bb2eventlogmaxtime);
 		}
 		else if (strcmp(p, "acklog.sh") == 0) {
 			if (bb2acklog && !havedoneacklog) do_acklog(output, 25, 240);
@@ -1202,7 +1202,7 @@
 		do_bb2ext(output, "BBMKBB2EXT", "mkbb");
 
 		/* Dont redo the eventlog or acklog things */
-		if (bb2eventlog && !havedoneeventlog) do_eventlog(output, 0, 240, 0);
+		if (bb2eventlog && !havedoneeventlog) do_eventlog(output, 0, 240);
 		if (bb2acklog && !havedoneacklog) do_acklog(output, 25, 240);
 	}
 
--- bbdisplay/eventlog.c	2005/03/22 09:03:37	1.17
+++ bbdisplay/eventlog.c	2005/04/04 05:42:57
@@ -48,7 +48,7 @@
 	return result;
 }
 
-void do_eventlog(FILE *output, int maxcount, int maxminutes, int allowallhosts)
+void do_eventlog(FILE *output, int maxcount, int maxminutes)
 {
 	FILE *eventlog;
 	char eventlogfilename[PATH_MAX];
@@ -117,7 +117,7 @@
 
 		if ( (itemsfound == 8) && 
 		     (eventtime > cutoff) && 
-		     (allowallhosts || (eventhost && !eventhost->nobb2)) && 
+		     (eventhost && !eventhost->nobb2) && 
 		     (wanted_eventcolumn(svcname)) ) {
 
 			newevent = (event_t *) malloc(sizeof(event_t));
@@ -335,7 +335,7 @@
 
 	headfoot(stdout, "event", "", "header", COL_GREEN);
 	fprintf(stdout, "<center>\n");
-	do_eventlog(stdout, maxcount, maxminutes, 1);
+	do_eventlog(stdout, maxcount, maxminutes);
 	fprintf(stdout, "</center>\n");
 	headfoot(stdout, "event", "", "footer", COL_GREEN);
 
--- bbdisplay/eventlog.h	2005/03/22 09:03:37	1.3
+++ bbdisplay/eventlog.h	2005/04/04 05:43:14
@@ -14,6 +14,6 @@
 extern char *eventignorecolumns;
 extern int havedoneeventlog;
 
-extern void do_eventlog(FILE *output, int maxcount, int maxminutes, int allowallhosts);
+extern void do_eventlog(FILE *output, int maxcount, int maxminutes);
 
 #endif


More information about the Xymon mailing list