Olivier
2017-Feb-17 15:38 UTC
[asterisk-users] Which tool to automatically restart Asterisk ?
Hello, Years ago, I used Monit to monitor Asterisk and restart it whenever it failed. Now, I wonder which tool I should pick for an Debian 8 (current) or CentOS 7 (future) environment. The main reason I'm looking for this tool is to avoid as much as possible, current 5 minutes delay between Asterisk's stop and first cutomers complains. 1. I always install Asterisk from source but I've read in Debian Stretch /etc/defaul/asterisk file, the following: # RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart upon # crash). This is generally less tested and has some known issues # with properly starting and stopping Asterisk. Where I can read about those known issues ? (not found in [1]). 2. For systemd envs where /etc/init.d files are still used, what do you recommend ? 3. For systemd envs where /etc/init.d files are not used anymore, what do you recommend ? 4. Suggestions ? Regards [1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=asterisk;dist=unstable -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170217/d61e876a/attachment.html>
Stefan Tichy
2017-Feb-17 16:13 UTC
[asterisk-users] Which tool to automatically restart Asterisk ?
On Fri, Feb 17, 2017 at 04:38:47PM +0100, Olivier wrote:> 3. For systemd envs where /etc/init.d files are not used anymore, what do > you recommend ?Even if /etc/init.d/ files are still used for other services, asterisk may have a unit file in /etc/systemd/system/ [Unit] Description=Asterisk ..... [Service] Restart=on-failure RestartSec=15s ExecStopPost=-/usr/local/bin/send-some-mail ..... -- Stefan Tichy ( asterisk3 at pi4tel dot de )
Tech Support
2017-Feb-20 14:29 UTC
[asterisk-users] Which tool to automatically restart Asterisk ?
Hello; Over time, we?ve built a huge enterprise level monitoring system for our internal and customer PBX?s. Using Nagios as the core, along with Grafana, Graphite, Carbon, Whisper, etc. so we can also create custom dynamic dashboards, we typically monitor over 1,000 different metrics for each PBX. For something like monitoring a system process like Asterisk, besides just checking to see if the process is running or not, we also check about a dozen or so related metrics like memory and cpu usage. If anything gets out of whack, the system runs the event handler to restart Asterisk. All the plugins are written in Perl, so they?re very easy to modify. What I can do if there is an interest is take the Asterisk plugin, strip out everything that wouldn?t apply to someone not using our system, and make it available to the general public. It's up to you guys. What do you think? Would people find that useful? Regards; John V. From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Olivier Sent: Friday, February 17, 2017 10:39 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Which tool to automatically restart Asterisk ? Hello, Years ago, I used Monit to monitor Asterisk and restart it whenever it failed. Now, I wonder which tool I should pick for an Debian 8 (current) or CentOS 7 (future) environment. The main reason I'm looking for this tool is to avoid as much as possible, current 5 minutes delay between Asterisk's stop and first cutomers complains. 1. I always install Asterisk from source but I've read in Debian Stretch /etc/defaul/asterisk file, the following: # RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart upon # crash). This is generally less tested and has some known issues # with properly starting and stopping Asterisk. Where I can read about those known issues ? (not found in [1]). 2. For systemd envs where /etc/init.d files are still used, what do you recommend ? 3. For systemd envs where /etc/init.d files are not used anymore, what do you recommend ? 4. Suggestions ? Regards [1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=asterisk;dist=unstable -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170220/1c40ac71/attachment.html>
Victor Villarreal
2017-Feb-20 14:36 UTC
[asterisk-users] Which tool to automatically restart Asterisk ?
Hi, Oliver. Maybe something like this (add this script to your crontab): ------------------------8<-------------------------- #!/bin/bash # # File: asterisk-watchdog.sh # Date: 2015.05.26 # Build: v1.0 # Brief: Secuencia para monitorizar procesos. # # ${PATH}: Variable de entorno con las rutas a los ejecutables. PATH=/bin:/sbin:/usr/bin:/usr/sbin # ${DAEMON}: Demonio a monitorizar. DAEMON="asterisk" # ${MSG}: Cuerpo del mensaje a enviar por mail. MSG="$(date '+%F %T'): ${DAEMON} se ha caido!" pidof ${DAEMON} > /dev/null 2>&1 [ $? -ne 0 ] && { echo ${MSG}; service ${DAEMON} start; } exit 0 --------------------------->8----------------------- 2017-02-20 11:29 GMT-03:00 Tech Support <asterisk at voipbusiness.us>:> Hello; > > Over time, we?ve built a huge enterprise level monitoring system for > our internal and customer PBX?s. Using Nagios as the core, along with > Grafana, Graphite, Carbon, Whisper, etc. so we can also create custom > dynamic dashboards, we typically monitor over 1,000 different metrics for > each PBX. For something like monitoring a system process like Asterisk, > besides just checking to see if the process is running or not, we also > check about a dozen or so related metrics like memory and cpu usage. If > anything gets out of whack, the system runs the event handler to restart > Asterisk. All the plugins are written in Perl, so they?re very easy to > modify. What I can do if there is an interest is take the Asterisk plugin, > strip out everything that wouldn?t apply to someone not using our system, > and make it available to the general public. It's up to you guys. What do > you think? Would people find that useful? > > Regards; > > John V. > > > > *From:* asterisk-users-bounces at lists.digium.com [mailto:asterisk-users- > bounces at lists.digium.com] *On Behalf Of *Olivier > *Sent:* Friday, February 17, 2017 10:39 AM > *To:* Asterisk Users Mailing List - Non-Commercial Discussion > *Subject:* [asterisk-users] Which tool to automatically restart Asterisk ? > > > > Hello, > > Years ago, I used Monit to monitor Asterisk and restart it whenever it > failed. > > Now, I wonder which tool I should pick for an Debian 8 (current) or CentOS > 7 (future) environment. > > The main reason I'm looking for this tool is to avoid as much as possible, > current 5 minutes delay between Asterisk's stop and first cutomers > complains. > > > > 1. I always install Asterisk from source but I've read in Debian Stretch > /etc/defaul/asterisk file, the following: > # RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart > upon > # crash). This is generally less tested and has some known > issues > # with properly starting and stopping Asterisk. > > Where I can read about those known issues ? > > (not found in [1]). > > 2. For systemd envs where /etc/init.d files are still used, what do you > recommend ? > > 3. For systemd envs where /etc/init.d files are not used anymore, what do > you recommend ? > > 4. Suggestions ? > > Regards > > > > [1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg> asterisk;dist=unstable > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk. > org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- GnuPG Key ID: 0x39BCA9D8 https://www.github.com/mefhigoseth ...:::[ God Rulz ! ]:::... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170220/ff270e89/attachment.html>