<div dir="ltr"><div>Hi, Oliver.<br><br></div>Maybe something like this (add this script to your crontab):<br><br>------------------------8<--------------------------<br><br>#!/bin/bash<br>#<br># File: asterisk-watchdog.sh<br># Date: 2015.05.26<br># Build: v1.0<br># Brief: Secuencia para monitorizar procesos.<br>#<br># ${PATH}: Variable de entorno con las rutas a los ejecutables.<br>PATH=/bin:/sbin:/usr/bin:/usr/sbin<br><br># ${DAEMON}: Demonio a monitorizar.<br>DAEMON="asterisk"<br><br># ${MSG}: Cuerpo del mensaje a enviar por mail.<br>MSG="$(date '+%F %T'): ${DAEMON} se ha caido!"<br><br>pidof ${DAEMON} > /dev/null 2>&1<br><br>[ $? -ne 0 ] && { echo ${MSG}; service ${DAEMON} start; }<br><br>exit 0<br><br>--------------------------->8-----------------------<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-20 11:29 GMT-03:00 Tech Support <span dir="ltr"><<a href="mailto:asterisk@voipbusiness.us" target="_blank">asterisk@voipbusiness.us</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div class="m_7449383436433685885WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hello;<u></u><u></u></span></p><p class="MsoNormal" style="text-align:justify"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> 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?<u></u><u></u></span></p><p class="MsoNormal" style="text-align:justify"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards;<u></u><u></u></span></p><p class="MsoNormal" style="text-align:justify"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">John V.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.<wbr>digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-<wbr>bounces@lists.digium.com</a>] <b>On Behalf Of </b>Olivier<br><b>Sent:</b> Friday, February 17, 2017 10:39 AM<br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br><b>Subject:</b> [asterisk-users] Which tool to automatically restart Asterisk ?<u></u><u></u></span></p></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify">Hello,<u></u><u></u></p></div><p class="MsoNormal" style="text-align:justify">Years ago, I used Monit to monitor Asterisk and restart it whenever it failed.<br><br>Now, I wonder which tool I should pick for an Debian 8 (current) or CentOS 7 (future) environment.<u></u><u></u></p></div><div><p class="MsoNormal" style="text-align:justify">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.<u></u><u></u></p></div><div><p class="MsoNormal" style="text-align:justify"><u></u> <u></u></p></div><div><p class="MsoNormal" style="text-align:justify">1. I always install Asterisk from source but I've read in Debian Stretch /etc/defaul/asterisk file, the following:<br># RUNASTSAFE: run safe_asterisk rather than asterisk (will auto-restart upon<br># crash). This is generally less tested and has some known issues<br># with properly starting and stopping Asterisk.<u></u><u></u></p></div><div><p class="MsoNormal" style="text-align:justify">Where I can read about those known issues ?<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify">(not found in [1]).<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify">2. For systemd envs where /etc/init.d files are still used, what do you recommend ?<br><br>3. For systemd envs where /etc/init.d files are not used anymore, what do you recommend ?<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify">4. Suggestions ?<u></u><u></u></p></div><div><p class="MsoNormal" style="text-align:justify">Regards<u></u><u></u></p></div><div><p class="MsoNormal" style="text-align:justify"><br><br>[1] <a href="https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=asterisk;dist=unstable" target="_blank">https://bugs.debian.org/cgi-<wbr>bin/pkgreport.cgi?pkg=<wbr>asterisk;dist=unstable</a><u></u><u></u></p></div></div></div></div></div></div><br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">GnuPG Key ID: 0x39BCA9D8<br><a href="https://www.github.com/mefhigoseth" target="_blank">https://www.github.com/mefhigoseth</a><br>...:::[ God Rulz ! ]:::...</div>
</div>