[hobbit] Incorrect links in msgs page

Henrik Stoerner henrik at hswn.dk
Thu Jun 8 23:05:00 CEST 2006


On Wed, Jun 07, 2006 at 12:30:55PM +0100, Morris, Chris (Shared Services) wrote:
> 
> Running hobbit-4.2-beta, monitoring 2 log files - on the msgs page the first
> Full Log link is actually to the second file.

This should fix it.


Regards,
Henrik

-------------- next part --------------
--- hobbitd/hobbitd_client.c	2006/06/08 11:22:53	1.87
+++ hobbitd/hobbitd_client.c	2006/06/08 20:59:54
@@ -728,7 +728,6 @@
 	strbuffer_t *logsummary;
 	int msgscolor = COL_GREEN;
 	char msgline[PATH_MAX];
-	char sectionname[PATH_MAX];
 	char *group;
 
 	for (swalk = sections; (swalk && strncmp(swalk->sname, "msgs:", 5)); swalk = swalk->next) ;
@@ -749,13 +748,12 @@
 		int logcolor;
 
 		clearstrbuffer(logsummary);
-		sprintf(sectionname, "msgs:%s", swalk->sname+5);
 		if (strncmp(swalk->sdata, "Cannot open logfile ", 20) == 0) {
 			logcolor = COL_YELLOW;
 			addtobuffer(logsummary, "Logfile not accessible");
 		}
 		else {
-			logcolor = scan_log(hinfo, clientclass, swalk->sname+5, swalk->sdata, sectionname, logsummary);
+			logcolor = scan_log(hinfo, clientclass, swalk->sname+5, swalk->sdata, swalk->sname, logsummary);
 		}
 
 		if (logcolor > msgscolor) msgscolor = logcolor;
@@ -763,20 +761,20 @@
 		switch (logcolor) {
 		  case COL_GREEN:
 			sprintf(msgline, "\nNo entries in <a href=\"%s\">%s</a>\n", 
-				hostsvcclienturl(hostname, sectionname), swalk->sname+5);
+				hostsvcclienturl(hostname, swalk->sname), swalk->sname+5);
 			addtobuffer(greendata, msgline);
 			break;
 
 		  case COL_YELLOW: 
 			sprintf(msgline, "\n&yellow Warnings in <a href=\"%s\">%s</a>\n", 
-				hostsvcclienturl(hostname, sectionname), swalk->sname+5);
+				hostsvcclienturl(hostname, swalk->sname), swalk->sname+5);
 			addtobuffer(yellowdata, msgline);
 			addtostrbuffer(yellowdata, logsummary);
 			break;
 
 		  case COL_RED:
 			sprintf(msgline, "\n&red Critical entries in <a href=\"%s\">%s</a>\n", 
-				hostsvcclienturl(hostname, sectionname), swalk->sname+5);
+				hostsvcclienturl(hostname, swalk->sname), swalk->sname+5);
 			addtobuffer(reddata, msgline);
 			addtostrbuffer(reddata, logsummary);
 			break;
@@ -824,7 +822,7 @@
 	for (swalk = sections; (swalk && strncmp(swalk->sname, "msgs:", 5)); swalk = swalk->next) ;
 	while (swalk) {
 		sprintf(msgline, "\nFull log <a href=\"%s\">%s</a>\n", 
-			hostsvcclienturl(hostname, sectionname), swalk->sname+5);
+			hostsvcclienturl(hostname, swalk->sname), swalk->sname+5);
 		addtostatus(msgline);
 		addtostatus(swalk->sdata);
 		do { swalk=swalk->next; } while (swalk && strncmp(swalk->sname, "msgs:", 5));


More information about the Xymon mailing list