[smokeping-users] Re: Valid alertee syntax?

Ralf Hildebrandt Ralf.Hildebrandt at charite.de
Mon Sep 13 14:44:36 MEST 2004


* 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;
			    
-- 
_________________________________________________

  Charité - Universitätsmedizin Berlin
_________________________________________________

  Ralf Hildebrandt
   i.A. des IT-Zentrum | Netzwerkdienste
   Stabsstelle des Klinikumsvorstandes
   Campus Mitte
   Schumannstr. 20/21 | D-10177 Berlin
   Tel. +49 30 450 570155 | Fax +49 30 450 570916
   Ralf.Hildebrandt at Charite.de
   http://www.charite.de


--
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