[xymon] Hobbit WebPage Question

Henrik Størner henrik at hswn.dk
Wed Jan 26 15:22:11 CET 2011


In <BAY145-w41B73E3F0C745A39BDA0C6CFFF0 at phx.gbl> James Isolder <isolderj at hotmail.com> writes:

>I wonder if it would be possible on the All Non Green View to have instead =
>of gifs how long the service has been in that state with the relevant colou=
>r.

That information is available if you let your mouse "hover" over the 
status icon.

It is possible to change from showing the status icon to showing
the duration of the latest status - I've included a small patch
against 4.3.0-RC1 that does this (on the "All non-green" and the
"Critical systems" pages, and only for red/yellow status). But I 
don't think it is something that I would want generally.

Regards,
Henrik

Index: xymongen/pagegen.c
===================================================================
--- xymongen/pagegen.c	(revision 6626)
+++ xymongen/pagegen.c	(working copy)
@@ -53,6 +53,7 @@
 int  critonlyreds = 0;
 int  wantrss = 0;
 int  nongreencolors = ((1 << COL_RED) | (1 << COL_YELLOW) | (1 << COL_PURPLE));
+int  showstatusduration = 1;
 
 /* Format strings for htaccess files */
 char *htaccess = NULL;
@@ -471,10 +472,17 @@
 						do_rss_item(rssoutput, h, e);
 					}
 
-					fprintf(output, "<IMG SRC=\"%s/%s\" ALT=\"%s\" TITLE=\"%s\" HEIGHT=\"%s\" WIDTH=\"%s\" BORDER=0></A>",
-						skin, dotgiffilename(e->color, e->acked, e->oldage),
-						htmlalttag, htmlalttag,
-						xgetenv("DOTHEIGHT"), xgetenv("DOTWIDTH"));
+					if (showstatusduration && ((e->color == COL_RED) || (e->color == COL_YELLOW)) && (pagetype != PAGE_NORMAL)) {
+						fprintf(output, "<font color=%s>%s</font>", colorname(e->color), e->age);
+					}
+					else {
+						fprintf(output, "<IMG SRC=\"%s/%s\" ALT=\"%s\" TITLE=\"%s\" HEIGHT=\"%s\" WIDTH=\"%s\" BORDER=0>",
+							skin, dotgiffilename(e->color, e->acked, e->oldage),
+							htmlalttag, htmlalttag,
+							xgetenv("DOTHEIGHT"), xgetenv("DOTWIDTH"));
+					}
+
+					fprintf(output, "</A>");
 				}
 				else {
 					/* Report format output */




More information about the Xymon mailing list