Xymon Mailing List Archive search

PAGE= matching not working (Hobbit 4.0.2 Debian package)

4 messages in this thread

list Christian Perrier · Fri, 13 May 2005 14:04:01 +0200 ·
I'm in trouble getting PAGE= alert working.

From my /etc/hobbit/bb-hosts file:

.../...
subpage CP Serveurs C. Perrier
172.24.16.2     adonis.cma.onera #  ssh ftp smtp ntp dns testip
144.204.16.17   amenophis #   ssh ntp testip
125.1.17.70     bastet #  ssh ftp smtp ntp
.../...


From /etc/hobbit/hobbit-alerts.cfg:
PAGE=CP TIME=W:0600:1800
  MAIL user-55ed6bc46f36@xymon.invalid REPEAT=1440 RECOVERED

testing this:

root at nephtys:/etc/hobbit/web# /usr/lib/hobbit/server/bin/bbcmd --env=/etc/hobbit/hobbitserver.cfg hobbitd_alert --test bastet conn
00018699 2005-05-13 14:00:29 send_alert bastet:conn state Paging
00018699 2005-05-13 14:00:29 Matching host:service:page 'bastet:conn:' against rule line 115
00018699 2005-05-13 14:00:29 Failed (pagename not in include list)


If I change hobbit-alerts.cfg:
HOST=adonis.mca.onera,amenophis,bastet TIME=W:0600:1800
  MAIL user-55ed6bc46f36@xymon.invalid REPEAT=1440 RECOVERED

root at nephtys:/etc/hobbit/web# /usr/lib/hobbit/server/bin/bbcmd --env=/etc/hobbit/hobbitserver.cfg hobbitd_alert --test bastet conn
00018718 2005-05-13 14:01:30 send_alert bastet:conn state Paging
00018718 2005-05-13 14:01:30 Matching host:service:page 'bastet:conn:' against rule line 116
00018718 2005-05-13 14:01:30 *** Match with 'MAIL user-55ed6bc46f36@xymon.invalid REPEAT=1440 RECOVERED' ***


So, it seems that PAGE= matchin does not work as expected....or am I
doing something wrong?


--
list Henrik Størner · Fri, 13 May 2005 14:37:15 +0200 ·
quoted from Christian Perrier
On Fri, May 13, 2005 at 02:04:01PM +0200, Christian Perrier wrote:
I'm in trouble getting PAGE= alert working.
From my /etc/hobbit/bb-hosts file:
.../...
subpage CP Serveurs C. Perrier
From /etc/hobbit/hobbit-alerts.cfg:
PAGE=CP TIME=W:0600:1800
  MAIL user-55ed6bc46f36@xymon.invalid REPEAT=1440 RECOVERED
The "PAGE" directive actually matches on the full page-path.
Your "CP" page is a subpage, so it must have a path longer than
just "CP" - so "PAGE=something/CP" should work. Or if you dont
care about the name of the higher-level page, use "PAGE=%.*/CP"

Henrik
list Christian Perrier · Fri, 13 May 2005 16:47:39 +0200 ·
quoted from Henrik Størner
The "PAGE" directive actually matches on the full page-path.
Your "CP" page is a subpage, so it must have a path longer than
just "CP" - so "PAGE=something/CP" should work. Or if you dont
care about the name of the higher-level page, use "PAGE=%.*/CP"
Hmmm, I'm afraid it doesnt work either..

PAGE=%.*/CP TIME=W:0600:1800
  MAIL user-55ed6bc46f36@xymon.invalid REPEAT=1440 RECOVERED

page DRIS DRIS hors infogerance
quoted from Christian Perrier
subpage CP Serveurs C. Perrier
172.24.16.2     adonis.cma.onera #  ssh ftp smtp ntp dns testip
144.204.16.17   amenophis #   ssh ntp testip
125.1.17.70     bastet #  ssh ftp smtp ntp

root at nephtys:/etc/hobbit# /usr/lib/hobbit/server/bin/bbcmd --env=/etc/hobbit/hobbitserver.cfg hobbitd_alert --test bastet conn
00023371 2005-05-13 16:46:32 send_alert bastet:conn state Paging
00023371 2005-05-13 16:46:32 Matching host:service:page 'bastet:conn:' against rule line 115
00023371 2005-05-13 16:46:32 Failed (pagename not in include list)

I also tried PAGE=DRIS/CP and even PAGE=%.*CP.*
list Henrik Størner · Sun, 15 May 2005 08:32:32 +0200 ·
quoted from Christian Perrier
On Fri, May 13, 2005 at 04:47:39PM +0200, Christian Perrier wrote:
The "PAGE" directive actually matches on the full page-path.
Your "CP" page is a subpage, so it must have a path longer than
just "CP" - so "PAGE=something/CP" should work. Or if you dont
care about the name of the higher-level page, use "PAGE=%.*/CP"
Hmmm, I'm afraid it doesnt work either..
[snip config]
quoted from Christian Perrier
root at nephtys:/etc/hobbit# /usr/lib/hobbit/server/bin/bbcmd --env=/etc/hobbit/hobbitserver.cfg hobbitd_alert --test bastet conn
00023371 2005-05-13 16:46:32 send_alert bastet:conn state Paging
00023371 2005-05-13 16:46:32 Matching host:service:page 'bastet:conn:' against rule line 115
00023371 2005-05-13 16:46:32 Failed (pagename not in include list)
The good news is that it's only the --test option that doesn't work.
It doesn't look up what the page-path is for a host, so it runs the
test assuming the host is on the top-level page.

When really used that info is provided differently, so it would work
as intended.

Attached is a patch that makes --test work the way you would expect
it to.


Regards,
Henrik

-------------- next part --------------
--- hobbitd/hobbitd_alert.c	2005/05/07 15:04:18	1.55
+++ hobbitd/hobbitd_alert.c	2005/05/15 06:29:24
@@ -269,7 +269,19 @@
 				return 1;
 			}
 
-			if (testpage == NULL) testpage = "";
+			if (testpage == NULL) {
+				namelist_t *hinfo;
• +				load_hostnames(xgetenv("BBHOSTS"), NULL, get_fqdn());
+				hinfo = hostinfo(testhost);
+				if (hinfo) {
+					testpage = strdup(bbh_item(hinfo, BBH_PAGEPATH));
+				}
+				else {
+					errprintf("Host not found in bb-hosts - assuming it is on the top page\n");
+					testpage = "";
+				}
+			}
 
 			awalk = (activealerts_t *)malloc(sizeof(activealerts_t));
 			awalk->hostname = find_name(&hostnames, testhost);