Changeset 358 for trunk/src


Ignore:
Timestamp:
Sep 20, 2011, 6:54:19 PM (13 years ago)
Author:
katerina
Message:

Patch for ticket #264 (Add a deadtime for correlate rules to avoid multiple reports).

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_log_check.c

    r357 r358  
    13151315        N_("logmonburstcron"),
    13161316        sh_repeat_set_cron,
     1317    },
     1318    {
     1319        N_("logmondeadtime"),
     1320        sh_keep_deadtime,
    13171321    },
    13181322    {
  • trunk/src/sh_log_correlate.c

    r357 r358  
    180180
    181181struct sh_mkeep * mkeep_list = NULL;
    182 
     182unsigned long     mkeep_deadtime = 60;
     183
     184int sh_keep_deadtime (const char * str)
     185{
     186  unsigned long  value;
     187  char * foo;
     188
     189  value = (size_t) strtoul(str, &foo, 0);
     190
     191  if (*foo == '\0') {
     192    mkeep_deadtime = value;
     193    return 0;
     194  }
     195  return -1;
     196}
    183197
    184198int sh_keep_match_add(const char * str, const char * queue,
     
    304318
    305319                  if ((mkeep->reported < now) &&
    306                       (60 < (now - mkeep->reported)))
     320                      (mkeep_deadtime < (unsigned int)(now - mkeep->reported)))
    307321                    {
    308322                      mkeep->reported = now;
Note: See TracChangeset for help on using the changeset viewer.