CABLE MODEM STATUS
Modem.pl is a small script that scrapes the web interface of a Motorola SURFboard cable modem for various status conditions like signal strength and signal to noise. The results are sent to STDOUT where they can be easily piped into a log file. The modem values are also checked for reasonable operating ranges. If the modem values are outside of reasonable operating ranges, results are also sent to STDERR. When run from a cron job, modem.pl can be used to monitor the condition of the cable service and notify someone before conditions cause service interruptions.
FEATURES
- Captures operating conditions of a Motorola SURFboard cable modem.
- Runs interactively or from a scheduled job (cron)
- Output is formatted with a standard log time stamp when scheduled.
- Checks modem values for reasonable operating ranges.
- Errors and warnings are duplicated to STDERR.
REQUIREMENTS
Perl 5.005 or above
Time::Local
LWP::Simple
INSTALL MODEM
The latest released or current version is available at http://www.littlefish.ca/projects/modem
- copy the modem-X.XX.tgz file to a local directory and unpack the archive.
for example:
download to ~/modem-X.XX.tgz
cd ~/
tar -zxvpf modem-X.XX.tgz
2. copy modem.pl to /usr/local/sbin.
cp ~/modem.pl /usr/local/sbin/modem.pl
3. That's it! You're done!
There are no command options. Simply run modem.pl to get the current status of your Motorola SURFboard cable modem.
SETUP CRON TO CHECK THE MODEM AT REGULAR INTERVALS
Modem.pl can be setup in crond to create regular status log entries. This can be very helpful troubleshooting intermittent cable problems. The sample.cron file will run modem.pl every 5 minutes, sending the results to /var/log/modem.log.
- copy the sample.cron to /etc/cron.d
cp ~/sample.cron /etc/cron.d/modem
2. restart the crond service (this step may be optional)
On most (all?) systems the /etc/cron.d directory is not normally checked for changes by the crond service. If this applies to your system then you will have to restart the crond service.
On RedHat systems you would use the service command:
service crond restart
CABLE MODEMS
This script was developed and tested on a Motorla SURFboard cable modem. (Model: SB5101).
It may work on other Motorla modems, but likely will not. If you have a different cable modem that works, or you would like to have work, please let me know.
02/17/2007
projects.AT.littlefish.ca
