HomeHome ArchiveArchive

Modem usage monitor

Last version version 0.32 Thu Jan 25 11:00:03 CET 2001

This programm is used to monitor modem usage over time (allthough it can easily be changed to monitor any other ressource). It generates an image showing modem/ressource usage over time, which can be incorporated in an automagically updated HTML page like this:

Analog ISDN

Modems are counted from top to bottom. A colored bar represents a modem being active. The number on the vertical axis is the tty-port-number so you have to add 1 to have the corresponding serial port-number that is the number of the modem.

The horizontal-axis represents the time axis. In this case it should represent 3days and 8 hours

License and Download

Modemusage it is a Perl script copyrighted by T.Pospisek under the GPL. You can download it here. If you use it, then please leave me a note.

README

The following is an excerpt from the README:

MODEMUSAGE
----------

Description:  This small Perl script generates a png with a x-y representation
              of modem(tty) usage over time. This can be very well used to
              display the modem usage on a web page.

Preliminary:  You need the GD library from http://www.boutell.com/gd/. You
              need Perl (http://www.perl.org) too.

Installation: 1) Decide where you want to have the png in and how it should be
                 called. Edit the config file. Find the line for the template:

                 $template = "/var/www/stats/usage.png";

                 and replace it by the absoltue path to the png. Do the same
                 with the line:

                 $grafik = "/var/ww/stats/usage_axe.png";

                 This is the actual picture. Edit the demo-www-page index.html
                 and change the location of the png file (here usage_axe.png)
                 appropriately.

              2) Edit the config file. Change the line my $n_modems = 32
                 to represent correctly the number of modems you've got.

              3) Find out how you can display a list of used ttys. On my system
                 (with a Cyclades board) I can do this with:

                 w -hs|fgrep ttyC|cut -b 14-17

                 Change the line:

                 my $get_ttys="w -hs|fgrep ttyC|cut -b 14-17";

                 appropriately.

              4) Decide on how often you want your modems to be checked. Edit
                 your crontab and put a command line like the following in it:

                 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root modemusage -f /etc/modemusage.cfg.

                 where /etc/modemusage.cfg is the config file.

                 Decide how long a period you want to monitor and change that
                 in the line:

                 my $x_s = 960 * $x_factor;

                 $x_factor represents the x-axe stretch factor and probably
                 doesn't need to be changed.

                 960 is the number of checks to represent in a picture.
                 To calculate the correct number for yourself you divide the
                 legth of the period in minutes you want to represent by the
                 length of the period a check is done. Since we're checking
                 every 5 minutes in cron 960 represents 3 1/3 days here...

              5) Well ok, go for it. You should be able to look at the
                 index.html page and have it refreshed every 5 minutes...
                 Good luck, and hope you'll have an easier job now finding
                 broken/hung modems...

Copyright etc.:  Programm written and (c) under GPL by T. Pospisek. The
                 homepage of this proggie is www.sourcepole.ch/sources/software/modemusage

Webmin patch for finer interface admin permissions

This patch enables finer granulation of interface administration. I.e. you can allow a user or a group to only administer certain interfaces. This refines the admin abilities of a certain user or group - it does not prevent them to screw up by giving the interface some illegal configuration.

Enjoy!

Patch against webmin 0.990

rename_bad_names.pl

This is a script to rename files with bad characters in their names. It is especially useful if you have to copy one windows filesystem encoded in some obscure character set over to another or to a linux partition which won’t understand or display correctly that character set.

Feedback welcome.

Enjoy!

rename_bad_names.pl

pppcosts 0.66

This page served as a repository for pppcosts, while the original site was not up to date with it. Meanwhile there’s a new version, pppcosts 0.66 at the original site. Check it out.