[smokeping-users] Re: Sending alerts to alternate addresses on a per target basis?

Dan McGinn-Combs Dan.McGinn-Combs at Geac.com
Fri Aug 8 20:16:14 MEST 2003

This is of course "doable" a couple of ways.

The way you have recommended would require some changes to the
Smokeping.pm code (not unreasonable) to go along with your recommended
changes to the config file.

The second way to handle this is to setup a script that handles the
decision about where to send messages based on the host that is being
alerted on. There is a point in the Smokeping.pm script which indicates
that if you prefix the "to" address in ***Alerts*** then it will execute
an external script rather than sending an email directly.


*** Alerts ***
# Standard Alert
to = |/usr/local/smokeping/bin/tell-someone.pl
from = smokealert at mydomain.com

Then in the external script "tell-someone.pl" you can have lines like

sendmail ($from,$fw-alert,$body) if ($ARGV[1] =~ /fw/);
sendmail ($from,$exchange-alert,$body) if ($ARGV[1] =~ /exchange/);
sendmail ($from,$router-alert,$body) if ($ARGV[1] =~ /router/);

where "sendmail" is the Perl code to send an alert and $fw-alert,
$exchange-alert and $router-alert are the e-mail addresses of the folks
managing the respective devices.


-----Original Message-----
From: Scott Schappell [mailto:archon at silvertree.org] 

Is it possible to have e-mail sent to different targets on an alert?


*** Alerts ***
from me at mydom.tld
to  me at mydom.tld
+ lossdetect
... define alert foo here

*** Targets ***
++ RemoteSite
menu = RemoteSite
title = RemoteSite
alerts = lossdetect
host =
alert_email = remote_contact at remotesite.tld, me at mydom.tld

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