Xymon Mailing List Archive search

Alternate pageset and noconn ?

list Dominique Frise
Tue, 30 May 2006 12:07:13 +0200
Message-Id: <user-f548b129056d@xymon.invalid>

Dominique Frise wrote:
Henrik Stoerner wrote:
On Mon, May 29, 2006 at 11:40:10AM +0200, user-bb3e9041f07f@xymon.invalid wrote:
But I got another problem ! I defined a host to appear twice on my defaut pageset, one time on page A and one time on page B. So, I used the 'noconn' directive in the bb-hosts to achieve this. Then, I would like this host to appear on my new pageset. I add MYPAGESET:mypage on the first host's line.
The question is why this host appears twice on the second pageset ?

This patch should fix it. It isn't pretty, but it should work.


Regards,
Henrik


--- bbdisplay/loadbbhosts.c    2006/05/03 21:12:33    1.43
+++ bbdisplay/loadbbhosts.c    2006/05/29 15:33:35
@@ -10,7 +10,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/ 
 -static char rcsid[] = "$Id: loadbbhosts.c,v 1.43 2006/05/03 21:12:33 henrik Exp $";
+static char rcsid[] = "$Id: loadbbhosts.c,v 1.44 2006/05/29 15:33:19 henrik Exp $";
  #include <limits.h>
 #include <stdio.h>
@@ -654,6 +654,24 @@
                 } while (cwalk &&                       (strcmp(cwalk->bbhostname, bbhost->bbhostname) == 0) &&
                      (targetpagecount < MAX_TARGETPAGES_PER_HOST) );
• +                /*
+                 * HACK: Check if the pageset tag is present at all in the host
+                 * entry. If it isn't, then drop this incarnation of the host.
+                 *
+                 * Without this, the following bb-hosts file will have the
+                 * www.hswn.dk host listed twice on the alternate pageset:
+                 *
+                 * adminpage nyc NYC
+                 *
+                 * 127.0.0.1   localhost      # bbd http://localhost/ CLIENT:osiris
+                 * 172.16.10.2 www.hswn.dk    # http://www.hswn.dk/ ADMIN:nyc ssh noinfo
+                 *
+                 * page superdome Superdome
+                 * 172.16.10.2 www.hswn.dk # noconn
+                 *
+                 */
+                if (strstr(STRBUF(inbuf), hosttag) == NULL) targetpagecount = 0;
             }
              if (strlen(pgset) == 0) {

This DOES fix it for us :-)

Thanks Henrik.

Dominique
UNIL - University of Lausanne

Henrik,

I think the fix does not cover the case where the same host should appear on different pages of an alternate pageset. We have such cases where a given host handles different services that should be grouped logically on different pages (Databases, Directories, File Sharing, Mail).

In following example, www.hswn.dk will appear twice on nyc.html and lau.html.


adminpage nyc NYC
acadpage lau LAU
127.0.0.1   localhost	# bbd http://localhost/ CLIENT:osiris
172.16.10.2 www.hswn.dk # http://www.hswn.dk/ ADMIN:nyc ssh noinfo
page superdome Superdome
172.16.10.2 www.hswn.dk # noconn ACAD:lau


Dominique
UNIL - University of Lausanne