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 --------- 1. Captures operating conditions of a Motorola SURFboard cable modem. 2. Runs interactively or from a scheduled job (cron) 3. Output is formatted with a standard log time stamp when scheduled. 4. Checks modem values for reasonable operating ranges. 5. Errors and warnings are duplicated to STDERR. 6. Support for RRDs database logging and graphing. REQUIREMENTS ------------ Perl 5.005 or above Time::Local LWP::Simple RRDs (optional) INSTALL MODEM ------------- The latest released or current version is available at http://www.littlefish.ca/projects/modem 1. 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-X.XX/modem.pl /usr/local/sbin/modem.pl 2a. (optional) copy modem_graph.pl to /usr/local/sbin. cp ~/modem-X.XX/modem_graph.pl /usr/local/sbin/modem_graph.pl * this step is optional. If you have the RRDs Perl package installed modem.pl will log data to an RRDs database from which modem_graph.pl will generate modem status graphs. 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. If the RRDs Perl Package is installed, results will also be logged to an RRDs database in /var/lib/RRDs/modem.rrd 1. copy the sample.cron to /etc/cron.d cp ~/modem-X.XX/sample.cron /etc/cron.d/modem or 1. copy the sample.cron.rrds to /etc/cron.d cp ~/modem-X.XX/sample.cron.rrds /etc/cron.d/modem The rrds sample executes modem.pl followed by modem_graph.pl. modem_graph.pl will update the status graph images (if required). 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. (Models: SB4200, SB5100, SB5100E, SB5101, SBV5120E). 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. 03/06/2007 projects.AT.littlefish.ca