----- Original Message -----
> On Aug 21, 2013, at 6:51 PM, 永豪 <yong...@taobao.com> wrote:
> 
> > I haven't go through many codes indeed, but TS-2143 make me sad, I love ATS
> > because in most case, we can provide a working solution for your
> > requirement. when you grow up, with big volumes, you will find out that
> > ATS still work, and you may discover more features than your imagine. it
> > is a good user experience compare to some other system, when you find out
> > that the system builder is really 'user oriented'.
> 
> 
> Hmmmm, this seems incredibly harsh. Attached is an alarms_example.sh script,
> that works exactly as the code used to do, except, it is less confusing. If
> you like, we can put that back in there.
> 
> Fwiw, I think this is much worse for the "newbies". If you don't know what
> you are doing, you will be sending emails from "nobody" to "admin", and you
> have no idea why. Best case scenario, the email vanish. Worst case scenario,
> they will eventually fill up /var/log/mail.

+1

I was the one driving that Alarms change, here's my take on it:

the interface was confusing and diffuse. You have configuration one one side
but the actual execution was out-sourced to a script. I found this dissatisfying
on one hand, and limiting. It wasn't left to anyone's imagination what the
script should do, it was set in records.config and our documentation, it should
email alarms.

Now, we've removed the email config, we've removed allocation and deallocation
of memory, which I would assume in a scenario where things are worth *alarming*
not to be helpful, and we've simplified the example. We should update the
documentation saying how you can do whatever you want with this script now.

You can email, yes. Or you can send a message to an SMS gateway. Or send an
snmp trap. Or put the message on a queue, where it will be picked up, etc..

That script can be as simple or complex as necessary, and even more complex
than a single parameter would allow. But its configuration should be drawn
from your infrastructure, not from ATS.



btw, the only reason I see right now for having an option for passing an
additional, configurable parameter to a script, is to use it for sending
"instance name" in a multi-instance setup.
Question does anyone in our community run multiple instances of ATS on the
the same node?

> I do agree with the review concerns, so if the consensus is to roll this
> back, lets do it fast.
> 
> -- leif
> 
> ostype=`(uname -s) 2>/dev/null`
> if [ "$ostype" = "Linux" ]; then
>   SENDMAIL="/usr/sbin/sendmail"
> else
>   SENDMAIL="/usr/lib/sendmail"
> fi
> 
> if [ ! -x $SENDMAIL ]; then
>     echo "$0: Could not find $SENDMAIL program"
>     exit 1
> fi
> 
> if [ $# -eq 2 ]; then
>   msg="`hostname` $1"
>   email_from_name="traffic server"
>   email_from_addr="nobody"
>   email_to_addr="admin"
> 
>   result=`(echo "From: $email_from_name <$email_from_addr>"; echo "To:
>   $email_to_addr"; echo "Subject: $msg"; echo; date) | $SENDMAIL -bm
>   $email_to_addr`
>   if [ "$result" = "" ]; then
>     echo
>     echo "[example_alarm_bin.sh] sent alarm: $msg";
>     echo
>     exit 0
>   else
>     echo
>     echo "[example_alarm_bin.sh] sendmail failed"
>     echo
>     exit 1
>   fi
> else
>   # give a little help
>   echo "Usage: example_alarm_bin.sh <message> [<email_from_name>
>   <email_from_addr> <email_to_addr>]"
>   exit
> 
> fi
> 
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.ga...@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Reply via email to