Quoting Alexander Samad <[EMAIL PROTECTED]>: > On Sun, Mar 28, 2004 at 12:02:01PM +1000, Amanda wrote: > > Quoting James Gray <[EMAIL PROTECTED]>: > > > > > > > > Amanda wrote: > > > > Have a pptp connection from SME server to windows 2000 vpn server. > > > > I'm looking for a bash script which will periodically (launched from > cron) > > > ping > > > > a machine on the remote network and restart pptp if it doesn't > respond. > > > > > > > > I wrote a similar thing for dos years ago which captured the output of > ping > > > into > > > > a text file, then looked for the string "reply from". > > > > > > > > I've been googling for ages but haven't found anything. > > > > > > > > thanks. > > > > > > > > Amanda > > > > > > Hi Amanda, > > > > > > I had a similar problem but pinging wasn't going to work - we use use > > > BGP and sometimes the routing table would get screwed up so ping would > > > fail even though the tunnel was still up. > > > > > > This would result in ppp1, ppp2, etc being started and wasn't what we > > > wanted. So we decided to use the status of the pppd processes (via it's > > > > PID file) to determine if the tunnel was active. Maybe you could use > > > James Greg's and John Clarke's solutions and build some of the logic > > > from my script into a home-spun thing for yourself. > > > > > > > Not sure this would work in my situation. The thing that will kill the > > connection in my case is the ISP (telstra) dropping the connection (ISDN) > after > > 5 hours. I'm currently testing all this from my home network (this server > will > > be going to Mackay in Qld); using ADSL. I'm re-booting my internal router > to > > simulate the connection being lost. If I then do "pptp-command status" it > > reports that the link is probably up. But pinging 10.0.0.150 (the machine > on the > > other end that mysql replicates against) gets no response. > > Why not do it the other way around and bring the connect down every 4h > 50 min. That way you could stop/halt/suspend anything that requires the > link and then restart once the link is back up >
Because that 5 hours is not set in concrete. This is Telstra don't forget. Besides, there's a million other reasons why the link could drop. Also, if I deliberately drop the link at 4 H 50 M, my users would be down for no really good reason. I've got enough problems keeping them happy as it is. When the ping fails, I'm also doing killall pppd & pptpd before starting a new tunnel. This should hopefully correct what James was saying about bringing up multiple tunnels. Just checked the tunnel. It's been up for the last 14 hours & working fine. Amanda Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
