diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-17 09:42:03 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-17 09:42:03 +0000 |
commit | 83c6a060be679722cefc531eaec40771ba5a3f21 (patch) | |
tree | cce8747ddb453151d478115f0da284114cc0a0cc /plugins/immark | |
parent | b5d69df3af01cf722f11c560c67cfa6b2b7cf765 (diff) | |
download | rsyslog-83c6a060be679722cefc531eaec40771ba5a3f21.tar.gz rsyslog-83c6a060be679722cefc531eaec40771ba5a3f21.tar.xz rsyslog-83c6a060be679722cefc531eaec40771ba5a3f21.zip |
implemented $MarkMessagePeriod config directive
Diffstat (limited to 'plugins/immark')
-rw-r--r-- | plugins/immark/immark.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c index 72750e65..bb074d5c 100644 --- a/plugins/immark/immark.c +++ b/plugins/immark/immark.c @@ -46,9 +46,8 @@ MODULE_TYPE_INPUT TERM_SYNC_TYPE(eTermSync_SIGNAL) /* Module static data */ -/* TODO: this needs a lot of work ;) */ DEF_OMOD_STATIC_DATA -static int bDoMarkMessages = 1; +static int iMarkMessagePeriod = 5; typedef struct _instanceData { } instanceData; @@ -77,7 +76,7 @@ CODESTARTrunInput * if a cleanup is needed. But for now, we can just use CHKiRet(). * rgerhards, 2007-12-17 */ - CHKiRet(thrdSleep(pThrd, 5, 0)); /* seconds, micro seconds */ + CHKiRet(thrdSleep(pThrd, iMarkMessagePeriod, 0)); /* seconds, micro seconds */ logmsgInternal(LOG_INFO, "-- MARK --", ADDDATE); //logmsgInternal(LOG_INFO, "-- MARK --", ADDDATE|MARK); } @@ -86,6 +85,13 @@ finalize_it: ENDrunInput +BEGINwillRun +CODESTARTwillRun + if(iMarkMessagePeriod == 0) + iRet = RS_RET_NO_RUN; +ENDwillRun + + BEGINfreeInstance CODESTARTfreeInstance ENDfreeInstance @@ -111,7 +117,7 @@ BEGINmodInit() CODESTARTmodInit *ipIFVersProvided = 1; /* so far, we only support the initial definition */ CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(omsdRegCFSLineHdlr((uchar *)"markmessages", 0, eCmdHdlrBinary, NULL, &bDoMarkMessages, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"markmessageperiod", 0, eCmdHdlrInt, NULL, &iMarkMessagePeriod, STD_LOADABLE_MODULE_ID)); ENDmodInit #endif /* #if 0 */ /* |