[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     [nocol-users] notes on notifier.pl


Hi,

first of all if notifier.pl runs every minute it always duplicates notifications
with $minage > 1min.
this patch seems to fix this.

228,230c213,214
<     if (($minage==0 && $eventage <=$crontime+1) ||
< 	($eventage > ($minage - $crontime/2) && 
< 	$eventage <= ($minage + $crontime/2 + 1)) ) { $donotify = 1; }
---
>     if ($eventage > ($minage - $crontime) && 
> 	$eventage <= ($minage + $crontime + 1) ) { $donotify = 1; }

Also, I'd like to post a piece of code to handle regexps in config file
I found it extrimerly usefull, and I would like to see it in future versions.
(actually I don't recognize the code, but it's not in 4.4beta1, so it must be mine :-)
 
<       if( grep { 
< 	  if($idv =~ /^$_$/) { 
< 	      print STDERR "+++ match! $idv and <$_>\n" if $debug>2;
< 	      &Notify($_);
< 	      1;
< 	  }
<       } keys( %notify)) {; }
<       elsif ( defined($notify{$idv}) ) { &Notify($idv); }
---
>       if    ( defined($notify{$idv}) ) { &Notify($idv); }

-- 
Dmitry Sazonov        <dmitry@bsc.lv>
IT,BankServiss, Riga  ph +371-7092553, mob: +371-9498710