PAGE= matching not working (Hobbit 4.0.2 Debian package)
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 perrier at alix.onera 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 perrier at alix.onera 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 perrier at alix.onera REPEAT=1440 RECOVERED' ***
So, it seems that PAGE= matchin does not work as expected....or am I doing something wrong?
--
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 perrier at alix.onera 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
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 perrier at alix.onera REPEAT=1440 RECOVERED
page DRIS DRIS hors infogerance 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.*
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]
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
participants (2)
-
Christian.Perrier@onera.fr
-
henrik@hswn.dk