[smokeping-users] Re: Valid alertee syntax?

Tobias Oetiker oetiker at ee.ethz.ch
Mon Sep 13 12:48:12 MEST 2004


Today Ralf Hildebrandt wrote:

> * Ralf Hildebrandt <Ralf.Hildebrandt at charite.de>:
> > Is this valid alertee syntax?
> >
> > + Terminalserver
> > menu = Terminalserver
> > title = Terminalserver
> > alerts = reachable,unreachable
> > alertee = xxx at charite.de,yyy at charite.de,|/usr/local/scripts/smokeping-overview.pl
> >
> > meaning, that the alert goes to xxx, yyy and gets piped into the script?
>
> Doesn't work. The list is not being split.
>
this should help

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

-- 
 ______    __   _
/_  __/_  / /  (_) 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

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