[Asterisk-Users] asterisk monitor
Ed Guy
edguy at pulver.com
Sun Sep 14 07:55:03 MST 2003
Every once in a while, our asterisk process hangs.
We haven't been able to figure out why, but
in the mean time, we've operated around the issue
using the brute force script below. I hope you find
this useful.
Cheers
/ed guy
#!/bin/bash
# routine to make sure asterisk is running well, and if not restart it.
# Ed Guy, edguy at pulver.com, September 1, 2003
# crontab entry
# * * * * * /root/bin/asteriskCheck.sh
asterisk=/usr/sbin/asterisk
logfile=/tmp/asta.log
# (echo "Asterisk check " ; date ) >> $logfile
# connect to asterisk and run a simple command.
$asterisk -r -x 'show version' >/dev/null
if [ "$?" -ne 0 ]
then
(echo "Asterisk Problem " ; date ) >> $logfile
killall -9 asterisk
sleep 3
$asterisk
fi
More information about the asterisk-users
mailing list