[hobbit] Zoomed in graphs lose hostname

Henrik Stoerner henrik at hswn.dk
Fri Apr 1 08:28:34 CEST 2005


On Thu, Mar 31, 2005 at 06:50:50AM -0500, Stuffle, David wrote:
> I know this is really minor, but when I zoom in on a graph the hostname at
> the top of the graph changes to "undefined".  It only matters when we print
> the graph, we don't know which host it was from.  Again, really minor but I
> thought I'd mention it in case it's one of those quicky fixes.

I think the attached patch fixes it. This was accidentally included in
the 4.0.1 update of the tar-file on Sourceforge, so if you installed
that you already have it.

Regards,
Henrik
-------------- next part --------------
--- lib/bblarrd.c	2005/03/25 07:42:19	1.28
+++ lib/bblarrd.c	2005/03/31 13:48:43	1.29
@@ -11,7 +11,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: bblarrd.c,v 1.28 2005/03/25 07:42:19 henrik Exp $";
+static char rcsid[] = "$Id: bblarrd.c,v 1.29 2005/03/31 13:48:43 henrik Exp $";
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -250,10 +250,8 @@
 					xgetenv("CGIBINURL"), hostname, rrdservicename);
 			}
 
-			if (dispname) {
-				strcat(svcurl, "&disp=");
-				strcat(svcurl, urlencode(dispname));
-			}
+			strcat(svcurl, "&disp=");
+			strcat(svcurl, urlencode(dispname ? dispname : hostname));
 
 			sprintf(rrdparturl, fmt, rrdservicename, svcurl, svcurl, rrdservicename, svcurl, xgetenv("BBSKIN"));
 			if ((strlen(rrdparturl) + strlen(rrdurl) + 1) >= rrdurlsize) {
@@ -278,10 +276,8 @@
 			sprintf(svcurl, "%s/larrd-grapher.cgi?host=%s&service=%s&%s=%d..%d", 
 				xgetenv("CGIBINURL"), hostname, rrdservicename,
 				graphdef->larrdpartname, first, last);
-			if (dispname) {
-				strcat(svcurl, "&disp=");
-				strcat(svcurl, urlencode(dispname));
-			}
+			strcat(svcurl, "&disp=");
+			strcat(svcurl, urlencode(dispname ? dispname : hostname));
 			sprintf(rrdparturl, fmt, svcurl, svcurl, rrdservicename, svcurl, xgetenv("BBSKIN"));
 			if ((strlen(rrdparturl) + strlen(rrdurl) + 1) >= rrdurlsize) {
 				rrdurlsize += (4096 + rrdparturlsize);
@@ -295,10 +291,8 @@
 	else {
 		sprintf(svcurl, "%s/larrd-grapher.cgi?host=%s&service=%s", 
 			xgetenv("CGIBINURL"), hostname, rrdservicename);
-		if (dispname) {
-			strcat(svcurl, "&disp=");
-			strcat(svcurl, urlencode(dispname));
-		}
+		strcat(svcurl, "&disp=");
+		strcat(svcurl, urlencode(dispname ? dispname : hostname));
 		sprintf(rrdurl, fmt, svcurl, svcurl, rrdservicename, svcurl, xgetenv("BBSKIN"));
 	}
 


More information about the Xymon mailing list