From 681a8a5ac210192ac032d8da0e4403b8251d0925 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 6 Nov 2013 09:16:54 +0100 Subject: doc: describe failover action preciseness --- doc/rsyslog_conf_actions.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/rsyslog_conf_actions.html b/doc/rsyslog_conf_actions.html index fa240d97..50b13a07 100644 --- a/doc/rsyslog_conf_actions.html +++ b/doc/rsyslog_conf_actions.html @@ -24,9 +24,9 @@ implemented via outpout modules.
  • type string
    Mandatory parameter for every action. The name of the module that should be used.
  • action.writeAllMarkMessages on/off -
    Normally, mark messages are written to actions only if the action was not recently executed (by default, recently means within the past 20 minutes). If this setting is switched to "on", mark messages are always sent to actions, no matter how recently they have been executed. In this mode, mark messages can be used as a kind of heartbeat. Note that this option auto-resets to "off", so if you intend to use it with multiple actions, it must be specified in front off all selector lines that should provide this functionality.
  • +
    Normally, mark messages are written to actions only if the action was not recently executed (by default, recently means within the past 20 minutes). If this setting is switched to "on", mark messages are always sent to actions, no matter how recently they have been executed. In this mode, mark messages can be used as a kind of heartbeat.
  • action.execOnlyEveryNthTime integer -
    If configured, the next action will only be executed every n-th time. For example, if configured to 3, the first two messages that go into the action will be dropped, the 3rd will actually cause the action to execute, the 4th and 5th will be dropped, the 6th executed under the action, ... and so on. Note: this setting is automatically re-set when the actual action is defined.
  • +
    If configured, the next action will only be executed every n-th time. For example, if configured to 3, the first two messages that go into the action will be dropped, the 3rd will actually cause the action to execute, the 4th and 5th will be dropped, the 6th executed under the action, ... and so on.
  • action.execOnlyEveryNthTimeout integer
    Has a meaning only if Action.ExecOnlyEveryNthTime is also configured for the same action. If so, the timeout setting specifies after which period the counting of "previous actions" expires and a new action count is begun. Specify 0 (the default) to disable timeouts. Why is this option needed? Consider this case: a message comes in at, eg., 10am. That's count 1. Then, nothing happens for the next 10 hours. At 8pm, the next one occurs. That's count 2. Another 5 hours later, the next message occurs, bringing the total count to 3. Thus, this message now triggers the rule. @@ -35,10 +35,19 @@ The question is if this is desired behavior? Or should the rule only be triggere
    This directive will timeout previous messages seen if they are older than 20 minutes. In the example above, the count would now be always 1 and consequently no rule would ever be triggered.
  • action.execOnlyOnceEveryInterval integer
    Execute action only if the last execute is at last seconds in the past (more info in ommail, but may be used with any action)
  • -
  • action.execOnlyWhenpReviousIsSuspended on/off -
    This directive allows to specify if actions should always be executed ("off," the default) or only if the previous action is suspended ("on"). This directive works hand-in-hand with the multiple actions per selector feature. It can be used, for example, to create rules that automatically switch destination servers or databases to a (set of) backup(s), if the primary server fails. Note that this feature depends on proper implementation of the suspend feature in the output module. All built-in output modules properly support it (most importantly the database write and the syslog message forwarder).
  • +
  • action.execOnlyWhenPreviousIsSuspended on/off +
    This directive allows to specify if actions should always be executed ("off," the default) or only if the previous action is suspended ("on"). + This directive works hand-in-hand with the multiple actions per selector feature. It can be used, for example, + to create rules that automatically switch destination servers or databases to a (set of) backup(s), if the + primary server fails. Note that this feature depends on proper implementation of the suspend feature in the + output module. All built-in output modules properly support it (most importantly the database write + and the syslog message forwarder).
    + Note, however, that a failed action may not immediately be detected. For more information, see the + rsyslog + execOnlyWhenPreviousIsSpuspended preciseness FAQ article. +
  • action.repeatedmsgcontainsoriginalmsg on/off -
    "last message repeated n times" messages, if generated, have a different format that contains the message that is being repeated. Note that only the first "n" characters are included, with n to be at least 80 characters, most probably more (this may change from version to version, thus no specific limit is given). The bottom line is that n is large enough to get a good idea which message was repeated but it is not necessarily large enough for the whole message. (Introduced with 4.1.5). Once set, it affects all following actions.
  • +
    "last message repeated n times" messages, if generated, have a different format that contains the message that is being repeated. Note that only the first "n" characters are included, with n to be at least 80 characters, most probably more (this may change from version to version, thus no specific limit is given). The bottom line is that n is large enough to get a good idea which message was repeated but it is not necessarily large enough for the whole message. (Introduced with 4.1.5).
  • action.resumeRetryCount integer
    [default 0, -1 means eternal]
  • action.resumeInterval integer -- cgit v1.2.3 From 4e04480206a6abae249f890e07fdecf380348c74 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 6 Nov 2013 12:26:57 +0100 Subject: omudpspoof: cleanup code that could never execute --- plugins/omudpspoof/omudpspoof.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/omudpspoof/omudpspoof.c b/plugins/omudpspoof/omudpspoof.c index 058c4252..cb907bba 100644 --- a/plugins/omudpspoof/omudpspoof.c +++ b/plugins/omudpspoof/omudpspoof.c @@ -525,9 +525,6 @@ static rsRetVal doTryResume(instanceData *pData) if(pData->pSockArray != NULL) FINALIZE; - if(pData->host == NULL) - ABORT_FINALIZE(RS_RET_DISABLE_ACTION); - if(pData->libnet_handle == NULL) { /* Initialize the libnet library. Root priviledges are required. * this initializes a IPv4 socket to use for forging UDP packets. @@ -571,8 +568,7 @@ finalize_it: freeaddrinfo(pData->f_addr); pData->f_addr = NULL; } - if(iRet != RS_RET_DISABLE_ACTION) - iRet = RS_RET_SUSPENDED; + iRet = RS_RET_SUSPENDED; } RETiRet; -- cgit v1.2.3 From 6b0e236cdf3d55299de70cf41dafdefec286f103 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 6 Nov 2013 13:06:48 +0100 Subject: cleanup unreachable code --- action.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/action.c b/action.c index eb6301d8..c46effc6 100644 --- a/action.c +++ b/action.c @@ -1945,20 +1945,14 @@ actionNewInst(struct nvlst *lst, action_t **ppAction) omodStringRequest_t *pOMSR; void *pModData; action_t *pAction; - int typeIdx; DEFiRet; paramvals = nvlstGetParams(lst, &pblk, NULL); if(paramvals == NULL) { - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_PARAM_ERROR); } dbgprintf("action param blk after actionNewInst:\n"); cnfparamsPrint(&pblk, paramvals); - typeIdx = cnfparamGetIdx(&pblk, "type"); - if(paramvals[typeIdx].bUsed == 0) { - errmsg.LogError(0, RS_RET_CONF_RQRD_PARAM_MISSING, "action type missing"); - ABORT_FINALIZE(RS_RET_CONF_RQRD_PARAM_MISSING); // TODO: move this into rainerscript handlers - } cnfModName = (uchar*)es_str2cstr(paramvals[cnfparamGetIdx(&pblk, ("type"))].val.d.estr, NULL); if((pMod = module.FindWithCnfName(loadConf, cnfModName, eMOD_OUT)) == NULL) { errmsg.LogError(0, RS_RET_MOD_UNKNOWN, "module name '%s' is unknown", cnfModName); -- cgit v1.2.3