D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Checking modem status

 

All

I have a serial modem hanging off /dev/modem

I run a daemon which triggers when it sees a file appear in a certain directory and starts by sending an "AT" to the modem and waits for an "OK" back. A cron job creates this file at 8pm (out of office hours) each evening.

Sometimes though, the previous day's activity frogs* the modem so "AT" never returns "OK" and the whole procedure stalls. The only way to kick it off again is to reboot the modem. It's fairly conveniently placed in an office so I'm thinking I could run a little script say at noon, which checks the modem is available (AT->OK) and if not, emails the local server monkey to reboot the modem.

Question is, what would said script look like (bash/perl/php)? Any suggestions on tools which could do the checking and return a result to a bash script for example?

Cheers

Martin
PS: My long term aim is to work out what's frogging* the modem in the first place - it will have to wait until I'm next at that location. PPS: "frog". "frogged": A term we used to use at Compuserve technical support many years ago referring to a broken/stalled/inactive modem - usually a cheap ZyXel or USR Sportster!

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq