[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] trends graph stop graphing



On Wed, Jan 21, 2009 at 11:30:01AM -0600, Bryan A Kennedy wrote:
> Hi.  We are running Hobbit v4.2.0 on a Red Hat Ent Linux WS rel 4 server.
> We have been running it for about two years without any issues (Great
> tool!).  A month and a half ago, the trends graphs stopped graphing.  I
> restart Hobbit/Xymon and the graphs start working for a few hours, then
> stop.
[snip]
> Looking in the rrd-status.log I do see entries with garbled data
> 2009-01-21 11:19:11 Bad data in channel, skipping it
> 2009-01-21 11:19:11 Dropping (more) garbled data
> 2009-01-21 11:22:35 Bad data in channel, skipping it
> 2009-01-21 11:22:35 Dropping (more) garbled data

This brings memories of a bug that I fixed a while back, but I
can see that it has only been fixed in the development version -
not in the 4.2.x series.

I think this patch - should work for both 4.2.0 and 4.2.2 -
will fix your problem. I'll add this for 4.2.3.


Regards,
Henrik

--- hobbit.rcs/hobbitd/hobbitd_worker.c	2006/11/23 21:12:13	1.31
+++ hobbit.rcs/hobbitd/hobbitd_worker.c	2007/05/28 07:45:26	1.32
@@ -387,11 +387,10 @@
 	}
 
 	/*
-	 * If the start of the next message doesn't begin with "@@" then 
+	 * If the start of the next message doesn't begin with "@" then 
 	 * there's something rotten.
-	 * It might be some data left-over from an oversized message.
 	 */
-	if (*startpos && strncmp(startpos, "@@", 2) != 0) {
+	if (*startpos && (*startpos != '@')) {
 		errprintf("Bad data in channel, skipping it\n");
 		startpos = strstr(startpos, "\n@@");
 		endpos = (startpos ? strstr(startpos, "\n@@\n") : NULL);
@@ -401,8 +400,10 @@
 		}
 
 		if (!startpos) {
-			startpos = buf;
-			fillpos = buf;
+			/* We're lost - flush the buffer and try to recover */
+			errprintf("Buffer sync lost, flushing data\n");
+			*buf = '\0';
+			startpos = fillpos = buf;
 			endpos = NULL;
 		}