[smokeping-users] Re: Valid alertee syntax?

Tobias Oetiker oetiker at ee.ethz.ch
Mon Sep 13 15:14:26 MEST 2004


Hi Ralf,
oops :-)

here is a better (bigger one)

tobi
Today Ralf Hildebrandt wrote:

> * Tobias Oetiker <oetiker at ee.ethz.ch>:
>
> > --- Smokeping.pm~       Mon Sep 13 12:39:49 2004
> > +++ Smokeping.pm        Mon Sep 13 12:47:29 2004
> > @@ -910,7 +910,7 @@
> >                          my $rtt = "rtt: ".join ", ",map {defined $_ ? (/^\d/ ? sprintf "%.0fms", $_*1000 :$_):"U" } @{$x->{rtt}};
> >                          my $stamp = scalar localtime time;
> >                         my @to;
> > -                       foreach my $addr ($cfg->{Alerts}{to},$tree->{alertee},$cfg->{Alerts}{$_}{to}){
> > +                       foreach my $addr (map {split /\s*,\s/, $_} $cfg->{Alerts}{to},$tree->{alertee},$cfg->{Alerts}{$_}{to}){
> >                              next unless $addr;
> >                              if ( $addr =~ /^\|(.+)/) {
> >                                  system $1,$_,$line,$loss,$rtt,$tree->{host};
>
>
> Against 1.31 please! My code looks totally different here:
>
>                         my $stamp = scalar localtime time;
>                         if ($cfg->{Alerts}{to} =~ /^\|(.+)/) {
>                            system $1,$_,$line,$loss,$rtt,$tree->{host};
>                         } else {
>                            my $to = $cfg->{Alerts}{to};
>                            $to .= ",".$tree->{alertee} if $tree->{alertee};
>                            sendmail $cfg->{Alerts}{from},$to, <<ALERT;
>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETL F24.2, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/oetiker +41(0)44-632-5286

-- Attached file removed by Ecartis and put at URL below --
-- Type: TEXT/PLAIN
-- Size: 3k (3493 bytes)
-- URL : http://www.ee.ethz.ch/~slist/p/03-patch


--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the smokeping-users mailing list