jonas kellens
2009-Aug-18 07:28 UTC
[asterisk-users] Execute some kind of script when something happens with Asterisk
Would it be possible to execute some kind of script when for example Asterisk restarts... or stops... ? How can one read the status of Asterisk so that when the service is stopped I could be notified by mail, by text message,... ? I don't know how to read the status of Asterisk (or the change of status) in a bash-script. Thanks for the reply ! Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090818/b1284ff7/attachment.htm
Patrick Plattes
2009-Aug-18 08:22 UTC
[asterisk-users] Execute some kind of script when something happens with Asterisk
Hi, well there are differnt ways to do it. It depends on what you want. The start-stop scripts in /etc/init.d/ are looking for a pid file, so they can figure out if the server is running. You can change the script to get a message if the server is going up or down by the script. If you want that the server is working correctly you need more. You need a second system and write an end-to-end test. Than you can send out an email (or a sms) if it fails. You can check it every 30s. The first way is easier, but you won't figure out if the server hangs. Maybe this is also interesting http://searchengine.of.choice/search?q=asterisk+watchdog Bye On Tue, Aug 18, 2009 at 9:28 AM, jonas kellens<jonas.kellens at telenet.be> wrote:> Would it be possible to execute some kind of script when for example > Asterisk restarts... or stops... ? > > How can one read the status of Asterisk so that when the service is stopped > I could be notified by mail, by text message,... ? > > I don't know how to read the status of Asterisk (or the change of status) in > a bash-script. > > Thanks for the reply ! > > Kind regards, > Jonas. > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2009 - October 13 - 15 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users >-- Niemann + Frey GmbH Bischofstra?e 80 47809 Krefeld Tel. +49 2151 5554-263 Gesch?ftsf?hrer: Gerd Frey Sitz und Registergericht: Krefeld HRB 10851
Steve Edwards
2009-Aug-18 13:17 UTC
[asterisk-users] Execute some kind of script when something happens with Asterisk
On Tue, 18 Aug 2009, jonas kellens wrote:> Would it be possible to execute some kind of script when for example > Asterisk restarts... or stops... ? > > How can one read the status of Asterisk so that when the service is > stopped I could be notified by mail, by text message,... ? > > I don't know how to read the status of Asterisk (or the change of > status) in a bash-script.