[Asterisk-Users] monitoring the asterisk and safe restart

Ulexus ulexus at mail.lifelabs.net
Sun Oct 26 09:01:56 MST 2003


I use daemontools ( http://cr.yp.to/daemontools.html ). 

Here, for instance, is my '/service/asterisk/run' script.  You only need the 
first uncommented line and the last uncommented line. You can ignore all of 
the networking stuff, but I wanted to know, if anyone else happened to see 
this, if  someone knew if zaptel's PPP device can use authenticated PPP 
(PAP/CHAT) in this case.  I had to get a special setup from my ISP to get a 
frame without PAP authentication.

/service/asterisk/run:
#!/bin/bash
#
#  Script to unload and reload asterisk and related networking functions
#

# Direct stderr to stdout so daemontools logger puts it all in log/main
exec 2>&1 

# Bring down network connections so ztcfg can run
ifconfig pvc0 down
ifconfig hdlc0 down
ifconfig hdlc1 down
ifconfig hdlc2 down
/etc/init.d/monmotha stop
/etc/init.d/monmotha zap

# Remove modules
rmmod wcfxs wcfxo tor2 zaptel

# Reload modules
modprobe tor2
modprobe wcfxo
modprobe wcfxs
sleep 3   # wcfxo doesn't like things too fast, so wait 3 sec

# Configure WAN cards
ztcfg -vvvv
sleep 3   # wcfxo doesn't like things too fast, so wait 3 sec
#
## Configure Frame to ISP
sethdlc hdlc0 mode fr-ansi create 16
ifconfig hdlc0 up
ifconfig pvc0 <local public ip> pointopoint <gateway ip> up
route add default gw <gateway ip>
#
## Configure WAN link to remote office 1
sethdlc hdlc1 mode hdlc
ifconfig hdlc1 192.168.1.1 pointopoint 192.168.1.2 up
route add -net 10.90.45.0 netmask 255.255.255.0 gw 192.168.1.2
#
## Configure WAN link to remote office 2
sethdlc hdlc2 mode ppp
ifconfig hdlc2 192.168.2.1 pointopoint 192.168.2.2 up
route add -net 10.90.33.0 netmask 255.255.255.0 gw 192.168.2.2
#
## Configure route to the rest of internal network
route add -net 10.90.0.0 netmask 255.255.0.0 gw 10.90.31.1 metric 2
#
## Start Firewall
/etc/init.d/monmotha start
#
## Start Asterisk
exec asterisk -vvvv


On Friday, 03 October, 2003 19:43, glin at cosini.com wrote:
> Hi List,
>
> I am sorry that I may bring the old question to the community. My question
> is
> 1. How can we determine if asterisk is working normally or not ? what kind
> watchdog process do we have at this moment ?
>
> 2. In case the running asterisk is mulfucntion, is there any available way
> to auto restart asterisk ??
>
> Please advise if you could.
>
> Thanks.
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list