glin@cosini.com
2003-Oct-03 16:43 UTC
[Asterisk-Users] monitoring the asterisk and safe restart
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.
Chris Albertson
2003-Oct-03 17:41 UTC
[Asterisk-Users] monitoring the asterisk and safe restart
Off the top of my head maybe something like this? while(1) asterisk wait `cat /var/run/astrisk.pid` sleep 1 end Looking at the above it could be improved, like checking for the /var/run/astrisk.pid file before the wait and bailing out if not found. --- glin@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@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users====Chris Albertson Home: 310-376-1029 chrisalbertson90278@yahoo.com Cell: 310-990-7550 Office: 310-336-5189 Christopher.J.Albertson@aero.org KG6OMK __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com
Leif Madsen
2003-Oct-03 21:44 UTC
[Asterisk-Users] monitoring the asterisk and safe restart
glin@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.I've never used it, but this sounds a lot like what the safe_asterisk script does... /usr/sbin/safe_asterisk /usr/src/asterisk/safe_asterisk HTH, Leif Madsen. FWD: 18924 IAX: 1700-363-0761
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@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@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users