[lwatch-cvs] files/src lwatch.conf,1.10,1.11 settings.c,1.12,1.13 settings.h,1.6,1.7 strpcre.c,1.13,
Brought to you by:
arturcz
|
From: <ar...@us...> - 2003-02-25 16:24:56
|
Update of /cvsroot/lwatch/files/src
In directory sc8-pr-cvs1:/tmp/cvs-serv21559/src
Modified Files:
lwatch.conf settings.c settings.h strpcre.c yparse.l
Log Message:
- directive match_host in config file added (requested by Przewdnik)
Index: lwatch.conf
===================================================================
RCS file: /cvsroot/lwatch/files/src/lwatch.conf,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** lwatch.conf 23 Jul 2002 12:23:07 -0000 1.10
--- lwatch.conf 25 Feb 2003 16:24:41 -0000 1.11
***************
*** 46,49 ****
--- 46,54 ----
}
+ /border/ {
+ match_host # if message is originated by host border
+ host_color=red # show its name in red
+ }
+
/kernel/ { # if string kernel ...
match_service # appears in service ...
Index: settings.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** settings.c 8 Aug 2002 14:35:24 -0000 1.12
--- settings.c 25 Feb 2003 16:24:42 -0000 1.13
***************
*** 195,199 ****
paction->ignore?"yes":"no",
paction->exit?"yes":"no",
! paction->match_service?"yes":"no");
printf("^^^^^^^^^^^^^^^^\n");
#endif
--- 195,200 ----
paction->ignore?"yes":"no",
paction->exit?"yes":"no",
! paction->match_service?"yes":"no",
! paction->match_host?"yes":"no");
printf("^^^^^^^^^^^^^^^^\n");
#endif
Index: settings.h
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** settings.h 23 Jul 2002 11:41:04 -0000 1.6
--- settings.h 25 Feb 2003 16:24:43 -0000 1.7
***************
*** 53,56 ****
--- 53,57 ----
highlight_color; /* highlight color from re */
int match_service, /* match service instead message */
+ match_host, /* match hostname instead message */
ignore, /* ignore this line and do not display */
exit; /* dont process next options */
Index: strpcre.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/strpcre.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** strpcre.c 8 Aug 2002 14:35:24 -0000 1.13
--- strpcre.c 25 Feb 2003 16:24:44 -0000 1.14
***************
*** 188,193 ****
if(lw_actions[i].match_service) {
match=serv_s; /* match service */
! } else {
! match=mesg_s; /* match message body */
}
n=pcre_exec(lw_actions[i].re,lw_actions[i].rh,
--- 188,193 ----
if(lw_actions[i].match_service) {
match=serv_s; /* match service */
! } else if (lw_actions[i].match_host) {
! match=host_s; /* match message body */
}
n=pcre_exec(lw_actions[i].re,lw_actions[i].rh,
Index: yparse.l
===================================================================
RCS file: /cvsroot/lwatch/files/src/yparse.l,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** yparse.l 8 Aug 2002 14:35:24 -0000 1.13
--- yparse.l 25 Feb 2003 16:24:45 -0000 1.14
***************
*** 71,75 ****
M_KEYWORD input_fifo|create_fifo
R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight
! R_KEYWORD match_service|ignore|exit
COLOR black|red|green|yellow|blue|magenta|cyan|white
STRING ".*"
--- 71,75 ----
M_KEYWORD input_fifo|create_fifo
R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight
! R_KEYWORD match_service|match_host|ignore|exit
COLOR black|red|green|yellow|blue|magenta|cyan|white
STRING ".*"
***************
*** 209,215 ****
--- 209,227 ----
}
<MULTI,ACTION>match_service {
+ if(action.match_host) {
+ die("Error in line %i: only one of match_service and match_host can be set.\n",lineno);
+ }
action.match_service=1;
#ifdef DEBUG
printf("Match service instead message\n");
+ #endif
+ }
+ <MULTI,ACTION>match_host {
+ action.match_host=1;
+ if(action.match_service) {
+ die("Error in line %i: only one of match_service and match_host can be set.\n",lineno);
+ }
+ #ifdef DEBUG
+ printf("Match hostname instead message\n");
#endif
}
|