summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/parse.y
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-02-07 15:17:47 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-02-07 15:17:47 +0000
commit3740f5b5e7e90adcd0be6513ddd3f8684cacde34 (patch)
tree7272f01760dc854689b773c8a27f5a0186cb8448 /usr.sbin/relayd/parse.y
parentfe851fcc379376cc9a46baa630ec734083adbc3f (diff)
add new "log (updates|all)" configuration option to log state
notifications after completed host checks. either only log the "updates" to new states or log "all" state notifications, even if the state didn't change. the log messages will be reported to syslog or to stderr if the daemon is running in foreground mode. ok claudio@ pyr@
Diffstat (limited to 'usr.sbin/relayd/parse.y')
-rw-r--r--usr.sbin/relayd/parse.y13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index af8c69d7d35..fe81c4569aa 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.22 2007/02/07 13:39:58 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.23 2007/02/07 15:17:46 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -102,10 +102,11 @@ typedef struct {
%token TIMEOUT CODE DIGEST PORT TAG INTERFACE
%token VIRTUAL IP INTERVAL DISABLE STICKYADDR
%token SEND EXPECT NOTHING USE SSL
+%token LOG UPDATES ALL
%token ERROR
%token <v.string> STRING
%type <v.string> interface
-%type <v.number> number port http_type
+%type <v.number> number port http_type loglevel
%type <v.host> host
%type <v.tv> timeout
@@ -201,11 +202,16 @@ sendbuf : NOTHING {
;
main : INTERVAL number { conf->interval.tv_sec = $2; }
+ | LOG loglevel { conf->opts |= $2; }
| TIMEOUT timeout {
bcopy(&$2, &conf->timeout, sizeof(struct timeval));
}
;
+loglevel : UPDATES { $$ = HOSTSTATED_OPT_LOGUPDATE; }
+ | ALL { $$ = HOSTSTATED_OPT_LOGALL; }
+ ;
+
service : SERVICE STRING {
struct service *srv;
@@ -537,6 +543,7 @@ lookup(char *s)
{
/* this has to be sorted always */
static const struct keywords keywords[] = {
+ { "all", ALL },
{ "backup", BACKUP },
{ "check", CHECK },
{ "code", CODE },
@@ -551,6 +558,7 @@ lookup(char *s)
{ "interface", INTERFACE },
{ "interval", INTERVAL },
{ "ip", IP },
+ { "log", LOG },
{ "nothing", NOTHING },
{ "port", PORT },
{ "real", REAL },
@@ -562,6 +570,7 @@ lookup(char *s)
{ "tag", TAG },
{ "tcp", TCP },
{ "timeout", TIMEOUT },
+ { "updates", UPDATES },
{ "use", USE },
{ "virtual", VIRTUAL }
};