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
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
David writes: >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. Thanks for the feedback, and its a good idea! We are monitoring about 45 servers right now with some 3rd party monitoring software, and looking to move it all to Nagios. Unfortunately our currently software doesn't give me as much flexibility on a per device basis to have it execute a script for each device that its monitoring to this level, but I'm thinking that we could customize Nagios to do this sort of thing. Its definitely worth exploring and I'll post back with the results. Thanks again. Myles -- ======================Myles Wakeham Director of Engineering Tech Solutions USA, Inc. Scottsdale, Arizona USA http://www.techsolusa.com Phone +1-480-451-7440
On 7/08/09 2:28 AM, Myles Wakeham wrote:> 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.We actually get customers to register to us, and then run a cronjob that checks their registrations are online. If not (they are connected to 5 of our servers) we use clickatel to send SMS messages to our cellphones. -- Cheers, Matt Riddell Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer) http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)