[asterisk-users] Monitoring Asterisk uptime

David Gibbons dave at videon-central.com
Thu Aug 6 09:42:43 CDT 2009


How about a shell script on the monitoring server:

#!/bin/sh
trunk=`ssh asterisk at astbox "asterisk -r -x 'sip show registry' | grep USERNAME"`

state=`echo $trunk | awk '{print $4}'

if state is 'Registered', yay!

else, UHOH!

EOF

Based on that ssh/shell script framework (you'd obviously need host keys to do this without user interation), you should be able to poll any linux server for really anything you want.

Someone who is in the business of selling hosted applications should be able to EASILY use awk and grep to figure out if his sip trunks are in the 'Registered' state via SSH... Unless I misunderstood the nature of your question and you were looking for something native to asterisk or the AMI.

-Dave

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Myles Wakeham
Sent: Thursday, August 06, 2009 10:28 AM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] Monitoring Asterisk uptime

We have added Asterisk to a line of 'mission critical' servers at our
business, and being in the web application development business one of
the core things we do is to monitor web server availability.

I'd like to add Asterisk to the servers that our monitoring systems are
handling, and also that our SIP trunk provider has our Asterisk system
correctly registered at all times.

What are the 'best practice' tricks used for monitoring an Asterisk
phone system for uptime and SIP registration from an external monitoring
server?  I can certainly ping the box, but I really need more than this.
  I need to know if the Asterisk service is running, and also that there
hasn't been any issues with SIP registration to our external trunks.

If anyone could share how they are doing this sort of thing, it would be
greatly appreciated.

Thanks
Myles
--
=======================
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona  USA
http://www.techsolusa.com
Phone +1-480-451-7440


_______________________________________________
-- 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



More information about the asterisk-users mailing list