Xymon Mailing List Archive search

bb2 problem with pageset ?

12 messages in this thread

list Beau Olivier · Thu, 20 Jul 2006 12:18:57 +0200 ·
Hi,

i'm running RC, and have noticed on the bb2 page of my UNIX pageset, that i have history event of all, not just of my unix servers...

Is this a bug ?


Olivier
list Henrik Størner · Thu, 20 Jul 2006 12:41:22 +0200 ·
quoted from Beau Olivier
On Thu, Jul 20, 2006 at 12:18:57PM +0200, Beau Olivier wrote:
i'm running RC, and have noticed on the bb2 page of my UNIX pageset, that i have history event of all, not just of my unix servers...

Is this a bug ?
No, the bb2 page shows all hosts defined in Hobbit that are non-green,
and the eventlog does the same.


Regards,
Henrik
list Beau Olivier · Thu, 20 Jul 2006 12:54:03 +0200 ·
Has that changed ? it wasnt like this before (4.1.2p2)

let me re-explain,
i have a global bb2.html and unix pageset and a nt pageset that i use for bb2.html only.
on my unix pageset bb2.html page, i have alerts of unix servers and eventlog of unix AND nt servers

i pretty confused..

olivier
quoted from Henrik Størner

-------- Message d'origine--------
De: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Date: jeu. 20/07/2006 12:41
À: user-ae9b8668bcde@xymon.invalid
Objet : Re: [hobbit] bb2 problem with pageset ?
 
On Thu, Jul 20, 2006 at 12:18:57PM +0200, Beau Olivier wrote:
i'm running RC, and have noticed on the bb2 page of my UNIX pageset, that i have history event of all, not just of my unix servers...

Is this a bug ?
No, the bb2 page shows all hosts defined in Hobbit that are non-green,
and the eventlog does the same.


Regards,
Henrik
list Francesco Duranti · Thu, 20 Jul 2006 13:27:44 +0200 ·
Same here now that I'm checking.
The bb2.html page for pageset is correct but the events in the bottom is reporting all events and not only those of the pageset.

Francesco
 

-----Messaggio originale-----
Da: Beau Olivier [mailto:user-9358a2fdac7a@xymon.invalid] 
Inviato: giovedì 20 luglio 2006 12.54
A: user-ae9b8668bcde@xymon.invalid
Oggetto: [hobbit] RE : [hobbit] bb2 problem with pageset ?
quoted from Beau Olivier


Has that changed ? it wasnt like this before (4.1.2p2)

let me re-explain,
i have a global bb2.html and unix pageset and a nt pageset that i use for bb2.html only.
on my unix pageset bb2.html page, i have alerts of unix servers and eventlog of unix AND nt servers

i pretty confused..

olivier

-------- Message d'origine--------
De: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Date: jeu. 20/07/2006 12:41
À: user-ae9b8668bcde@xymon.invalid
Objet : Re: [hobbit] bb2 problem with pageset ?
 
On Thu, Jul 20, 2006 at 12:18:57PM +0200, Beau Olivier wrote:
i'm running RC, and have noticed on the bb2 page of my UNIX pageset, that i have history event of all, not just of my unix servers...

Is this a bug ?
No, the bb2 page shows all hosts defined in Hobbit that are non-green, and the eventlog does the same.


Regards,
Henrik
list Nicolas Lienard · Thu, 20 Jul 2006 16:02:14 +0200 (CEST) ·
Hi,

On the server side, in hobbit-clients.cfg, i ve this:

DEFAULT
        UP      1h
        LOAD    5.0 10.0
        DISK    * 90 95
        MEMPHYS 100 101
        MEMSWAP 60 80
        MEMACT  95 97
        PROC    %(/usr/sbin/cron|crond).* 1 5

The problem is that some hosts have more than 5 cron running.

So i declared before DEFAULT section, a specific host to override the
global PROC values:

For instance, the host is called "mrtg-wat":

HOST=mrtg-wat
        PROC    %(/usr/sbin/cron|crond).* 1 20

But it doesn't work, Hobbit takes the 2 values as 2 differents check.

 %(/usr/sbin/cron|crond).* (found 26, req. between 1 and 20)
 %(/usr/sbin/cron|crond).* (found 26, req. between 1 and 5)

Is there a way to change this behaviour in order to override the DEFAULT
value for PROC ?

Hobbit version: hobbit-4.1.2p1

Thanks
Nicolas
list Henrik Størner · Thu, 20 Jul 2006 23:06:41 +0200 ·
quoted from Nicolas Lienard
On Thu, Jul 20, 2006 at 04:02:14PM +0200, Nicolas wrote:
DEFAULT
        UP      1h
        LOAD    5.0 10.0
        DISK    * 90 95
        MEMPHYS 100 101
        MEMSWAP 60 80
        MEMACT  95 97
        PROC    %(/usr/sbin/cron|crond).* 1 5
Putting PROC entries in the DEFAULT section is generally a bad idea,
unless you never - ever - want to have exceptions from the rule.

I'd suggest removing it from the default section, and using this
instead:

HOST=*
	PROC    %(/usr/sbin/cron|crond).* 1 5 EXHOST=mrtg-wat
	PROC    %(/usr/sbin/cron|crond).* 1 HOST=mrtg-wat

or some similar configuration.
Hobbit version: hobbit-4.1.2p1
Ouch, there's some problems with the config file parsing in the 4.1.2
releases. I'm not entirely sure the above will work in 4.1.2p1; you may 
have to list the hosts explicitly for this. It's fixed in the 4.2
release candidate currently being tested.


Regards,
Henrik
list Henrik Størner · Thu, 20 Jul 2006 23:57:06 +0200 ·
quoted from Beau Olivier
On Thu, Jul 20, 2006 at 12:54:03PM +0200, Beau Olivier wrote:
Has that changed ? it wasnt like this before (4.1.2p2)

let me re-explain,
i have a global bb2.html and unix pageset and a nt pageset that i use for bb2.html only.
on my unix pageset bb2.html page, i have alerts of unix servers and eventlog of unix AND nt servers
OK, I understand what you mean now - and yes, it seems this has changed
as the eventlog code was generalized into being used also for a stand-
alone reporting tool.

The attached patch should re-instate the old behaviour, please let me
know if it works.


Regards,
Henrik

-------------- next part --------------
--- lib/eventlog.c	2006/06/01 12:29:16	1.35
+++ lib/eventlog.c	2006/07/20 21:51:41
@@ -98,7 +98,8 @@
 		char *pageregex, char *expageregex,
 		char *hostregex, char *exhostregex,
 		char *testregex, char *extestregex,
-		char *colrregex, int ignoredialups)
+		char *colrregex, int ignoredialups,
+		f_hostcheck hostcheck)
 {
 	FILE *eventlog;
 	char eventlogfilename[PATH_MAX];
@@ -220,6 +221,7 @@
 		     (eventhost && !bbh_item(eventhost, BBH_FLAG_NOBB2)) && 
 		     (wanted_eventcolumn(svcname)) ) {
 			if (ignoredialups && bbh_item(eventhost, BBH_FLAG_DIALUP)) continue;
+			if (hostcheck && (hostcheck(hostname) == NULL)) continue;
 
 			if (pageregexp) {
 				char *pagename = bbh_item(eventhost, BBH_PAGEPATH);
--- lib/eventlog.h	2006/06/01 12:29:36	1.9
+++ lib/eventlog.h	2006/07/20 21:51:49
@@ -24,6 +24,7 @@
 	struct event_t *next;
 } event_t;
 
+typedef void * (*f_hostcheck)(char *hostname);
 
 extern char *eventignorecolumns;
 extern int havedoneeventlog;
@@ -32,6 +33,7 @@
 			char *pagematch, char *expagematch, 
 			char *hostmatch, char *exhostmatch, 
 			char *testmatch, char *extestmatch,
-			char *colormatch, int ignoredialups);
+			char *colormatch, int ignoredialups,
+			f_hostcheck hostcheck);
 
 #endif
--- web/bb-eventlog.c	2006/07/11 17:18:22	1.34
+++ web/bb-eventlog.c	2006/07/20 21:46:42
@@ -132,7 +132,7 @@
 	fprintf(stdout, "<center>\n");
 	do_eventlog(stdout, maxcount, maxminutes, fromtime, totime, 
 			pageregex, expageregex, hostregex, exhostregex, testregex, extestregex,
-			colrregex, ignoredialups);
+			colrregex, ignoredialups, NULL);
 	fprintf(stdout, "</center>\n");
 	headfoot(stdout, "event", "", "footer", COL_GREEN);
 
--- bbdisplay/pagegen.c	2006/07/20 16:06:41	1.176
+++ bbdisplay/pagegen.c	2006/07/20 21:41:50
@@ -986,7 +986,7 @@
 		/* Dont redo the eventlog or acklog things */
 		if (strcmp(p, "eventlog.sh") == 0) {
 			if (bb2eventlog && !havedoneeventlog) do_eventlog(output, bb2eventlogmaxcount, bb2eventlogmaxtime,
-				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, bb2nodialups);
+				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, bb2nodialups, find_host);
 		}
 		else if (strcmp(p, "acklog.sh") == 0) {
 			if (bb2acklog && !havedoneacklog) do_acklog(output, bb2acklogmaxcount, bb2acklogmaxtime);
@@ -1163,7 +1163,7 @@
 		do_bb2ext(output, "BBMKBB2EXT", "mkbb");
 
 		/* Dont redo the eventlog or acklog things */
-		if (bb2eventlog && !havedoneeventlog) do_eventlog(output, bb2eventlogmaxcount, bb2eventlogmaxtime, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, bb2nodialups);
+		if (bb2eventlog && !havedoneeventlog) do_eventlog(output, bb2eventlogmaxcount, bb2eventlogmaxtime, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, bb2nodialups, find_host);
 		if (bb2acklog && !havedoneacklog) do_acklog(output, bb2acklogmaxcount, bb2acklogmaxtime);
 	}
list Nicolas Lienard · Fri, 21 Jul 2006 11:21:00 +0200 (CEST) ·
HI,

Thanks for answear.

Indeed, it doesn't seem to work correctly with this hobbit version:

HOST=*
 PROC    %(/usr/sbin/cron|crond).* 1 5 EXHOST=mrtg-wat,test-host
 PROC    %(/usr/sbin/cron|crond).* 1 30 HOST=mrtg-wat
 PROC    %(/usr/sbin/cron|crond).* 1 6 HOST=test-host

The results for test-host on PROC was:

&unknown %(/usr/sbin/cron|crond).* (found 6, req. between 1 and 5)
green %(/usr/sbin/cron|crond).* (found 6, req. between 1 and 30)
green %(/usr/sbin/cron|crond).* (found 6, req. between 1 and 6)

Other servers which are'nt in EXHOST have this behaviour:

green %(/usr/sbin/cron|crond).* (found 1, req. between 1 and 5)
green %(/usr/sbin/cron|crond).* (found 1, req. between 1 and 30)
green %(/usr/sbin/cron|crond).* (found 1, req. between 1 and 6)

As you suggested, i changed conf like this (list the hosts explicitly) :

HOST=*
        PROC    %(/usr/sbin/cron|crond).* 1 5 EXHOST=mrtg-wat,gie-s2if-front2

HOST=test-host
        PROC    %(/usr/sbin/cron|crond).* 1 6

HOST=mrtg-wat
        PROC    %(/usr/sbin/cron|crond).* 1 30


it seems to work but there is a strange behaviour for the global rule and
EXHOST:

test-host PROC show this:

&unknown %(/usr/sbin/cron|crond).* (found 6, req. between 1 and 5)
green %(/usr/sbin/cron|crond).* (found 6, req. between 1 and 6)

Others hosts are OK (only the global PROC).

Do you know what the "unknown" state means ? is it obstructing ?

Thanks
Nicolas
quoted from Henrik Størner


Le Jeu 20 juillet 2006 23:06, Henrik Stoerner a écrit :
On Thu, Jul 20, 2006 at 04:02:14PM +0200, Nicolas wrote:
DEFAULT
UP      1h
LOAD    5.0 10.0
DISK    * 90 95
MEMPHYS 100 101
MEMSWAP 60 80
MEMACT  95 97
PROC    %(/usr/sbin/cron|crond).* 1 5
Putting PROC entries in the DEFAULT section is generally a bad idea,
unless you never - ever - want to have exceptions from the rule.

I'd suggest removing it from the default section, and using this
instead:


HOST=*
PROC    %(/usr/sbin/cron|crond).* 1 5 EXHOST=mrtg-wat
PROC    %(/usr/sbin/cron|crond).* 1 HOST=mrtg-wat


or some similar configuration.
Hobbit version: hobbit-4.1.2p1
Ouch, there's some problems with the config file parsing in the 4.1.2
releases. I'm not entirely sure the above will work in 4.1.2p1; you may
have to list the hosts explicitly for this. It's fixed in the 4.2 release
candidate currently being tested.


Regards,
Henrik

list Beau Olivier · Fri, 21 Jul 2006 14:54:17 +0200 ·
works !!

thanks :)

olivier

-----Message d'origine-----
De : Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Envoyé : jeudi 20 juillet 2006 23:57
À : user-ae9b8668bcde@xymon.invalid
Objet : Re: [hobbit] RE : [hobbit] bb2 problem with pageset ?


On Thu, Jul 20, 2006 at 12:54:03PM +0200, Beau Olivier wrote:
Has that changed ? it wasnt like this before (4.1.2p2)

let me re-explain,
i have a global bb2.html and unix pageset and a nt pageset that i use for bb2.html only.
on my unix pageset bb2.html page, i have alerts of unix servers and eventlog of unix AND nt servers
OK, I understand what you mean now - and yes, it seems this has changed
as the eventlog code was generalized into being used also for a stand-
alone reporting tool.

The attached patch should re-instate the old behaviour, please let me
know if it works.


Regards,
Henrik
list Beau Olivier · Thu, 27 Jul 2006 10:02:54 +0200 ·
Hi,

i'ld like to have custom graph using NCVq with a GAUGE, 
but hobbit creates the rrd with DERIVE..
here my definition: NCV_sessions="current_sessions:GAUGE,maxlimit:NONE"

is this a bug ?


olivier
list Charles Goyard · Thu, 27 Jul 2006 10:21:43 +0200 ·
quoted from Beau Olivier
Beau Olivier a écrit :
i'ld like to have custom graph using NCVq with a GAUGE, 
but hobbit creates the rrd with DERIVE..
here my definition: NCV_sessions="current_sessions:GAUGE,maxlimit:NONE"
That's because hobbit strips under_scores from the DS name. Try :

NCV_sessions="currentsessions:GAUGE,maxlimit:NONE"


-- 
Charles Goyard - user-98f9625a7a59@xymon.invalid - (+33) 1 45 38 01 31
list Beau Olivier · Thu, 27 Jul 2006 11:29:04 +0200 ·
works !!

thanks :)


olivier

-----Message d'origine-----
De : Charles Goyard [mailto:user-98f9625a7a59@xymon.invalid]
Envoyé : jeudi 27 juillet 2006 10:22
À : user-ae9b8668bcde@xymon.invalid
Objet : Re: [hobbit] graph ncv problem with RC ?


Beau Olivier a écrit :
i'ld like to have custom graph using NCVq with a GAUGE, 
but hobbit creates the rrd with DERIVE..
here my definition: NCV_sessions="current_sessions:GAUGE,maxlimit:NONE"
That's because hobbit strips under_scores from the DS name. Try :

NCV_sessions="currentsessions:GAUGE,maxlimit:NONE"


-- 
Charles Goyard - user-98f9625a7a59@xymon.invalid - (+33) 1 45 38 01 31