Hi, Occassionally Asterisk will go down and I have to restart it.. not often.. but sometimes. When it does the manager interface stops working, as does the CLI. My thoughts was to poll the manager interface once every 5 minutes for a value. If I don't get the value back then alert me that the server is possibly down. Does anyone know what a good value to poll for might be? I was thinking I could poll my SIP account for the CallWaiting value, but would like something that was not linked to my account. Just something that returns a single line is fine.
AFAIK there are problems with repeatedly connecting and disconnecting the manager interface. Also you're probably using a proxy (all "manager" interfaces I've seen are using proxies), it might not be a good idea to pool something out of the manager that often. Did you consider running a "cron" job on the server, using "asterisk -rx" to run a command and then decide rather asterisk is down or not based on the result? This way you'd be doing on the server, working around the problems with the manager interface and saving some bandwidth :). You might also be able to call /sbin/reboot directly from the cron script! If on the other hand the whole server is going down you may simply use ping!> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Matt > Sent: Thursday, March 02, 2006 7:47 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Polling Asterisk for Life > > Hi, > Occassionally Asterisk will go down and I have to restart it.. not > often.. but sometimes. When it does the manager interface stops > working, as does the CLI. > > My thoughts was to poll the manager interface once every 5 minutes for > a value. If I don't get the value back then alert me that the server > is possibly down. > > Does anyone know what a good value to poll for might be? I was > thinking I could poll my SIP account for the CallWaiting value, but > would like something that was not linked to my account. > > Just something that returns a single line is fine. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Obviously if Asterisk keeps going down there is another problem to be found. However, why not start it from /etc/inittab with respawn??? Else, poll from cron or a script with ps ax | grep asterisk | grep -v grep | wc -l to find out if it is running. dbc. Date: Thu, 2 Mar 2006 22:01:01 +0200 From: "Cosmin Prund" <cosmin@adicomsoft.ro> Subject: RE: [Asterisk-Users] Polling Asterisk for Life To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" <asterisk-users@lists.digium.com> Message-ID: <026301c63e34$08d7a6d0$a3512356@adicomsoft> Content-Type: text/plain; charset="us-ascii" AFAIK there are problems with repeatedly connecting and disconnecting the manager interface. Also you're probably using a proxy (all "manager" interfaces I've seen are using proxies), it might not be a good idea to pool something out of the manager that often. Did you consider running a "cron" job on the server, using "asterisk -rx" to run a command and then decide rather asterisk is down or not based on the result? This way you'd be doing on the server, working around the problems with the manager interface and saving some bandwidth :) . You might also be able to call /sbin/reboot directly from the cron script! If on the other hand the whole server is going down you may simply use ping!> > -----Original Message----- > > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > > bounces@lists.digium.com] On Behalf Of Matt > > Sent: Thursday, March 02, 2006 7:47 PM > > To: Asterisk Users Mailing List - Non-Commercial Discussion > > Subject: [Asterisk-Users] Polling Asterisk for Life > > > > Hi, > > Occassionally Asterisk will go down and I have to restart it.. not > > often.. but sometimes. When it does the manager interface stops > > working, as does the CLI. > > > > My thoughts was to poll the manager interface once every 5 minutes for > > a value. If I don't get the value back then alert me that the server > > is possibly down. > > > > Does anyone know what a good value to poll for might be? I was > > thinking I could poll my SIP account for the CallWaiting value, but > > would like something that was not linked to my account. > > > > Just something that returns a single line is fine.
On Mar 2, 2006, at 9:46 AM, Matt wrote:> Hi, > Occassionally Asterisk will go down and I have to restart it.. not > often.. but sometimes. When it does the manager interface stops > working, as does the CLI. > > My thoughts was to poll the manager interface once every 5 minutes for > a value. If I don't get the value back then alert me that the server > is possibly down.<snip>Doesn't it seem absurd to go through all these gyrations, rather then troubleshooting and fixing the problem? I know you have already tried without success, but this seems absurd to me. I am discomforted by the number of people saying they are rebooting nightly and have cron jobs to restart.
> So, simply respawning asterisk, or checking to see if it's running > isn't good enough, because asterisk is indeed running. We need to > access asterisk and issue a command, and see if asterisk responds > appropriately. If not, we can assume it has died, and we can kill it > off (killall -9 asterisk) and then start it back up again (or reboot > the whole server if necessary).The _only_ way to reliably (well, in as much as that is possible) to test if your Asterisk is working, is to build a monitoring system that does more or less the same as a typical user would do. We have a system with two modems connected to ATA's and they dial each other via multiple routes so we test all of the major scenarios. We only test if calls are routed through, not if the call itself establishes (media running) to prevent major costs from such a system. I works reasonably well, it seems to detect 99% of the major problems. -- Andreas Sikkema BBned NV Software Engineer Planeetbaan 4 +31 (0)23 7074342 2132 HZ Hoofddorp