[hobbit] RE : [hobbit] bb2 problem with pageset ?
Henrik Stoerner
henrik at hswn.dk
Thu Jul 20 23:57:06 CEST 2006
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);
}
More information about the Xymon
mailing list