Web Client Programming Using Perl

Web site monitoring of your system can be easy using Linux and Perl.
Starting Monitor.pl at System Boot

Copy HTTPPing.pl and Monitor.pl to the /bin directory, and change their permissions to make them executable. This permits them to be run by the system at system boot.

chmod +x Monitor.pl
chmod +x HTTPping.pl

You can start the Monitor.pl script when your system boots by taking advantage of a special script that is run every time your system boots. The /etc/rc.d/rc.local script is run by the system after all services have been started. By adding the following line to the end of your rc.local file, the Monitor.pl will be started at boot time.

Monitor.pl http://localhost 1234567 120 120 0 &
Then use a tool such as tksysv to add it to the run levels you want it to start in. On my system, I boot to run level 3, so I added it to the list of the programs to start in run level 3. This makes the monitoring station even more robust by enabling the monitoring scripts to start up at boot time. See Linux Journal issue 55 for a good introduction to init and services.


The solid server performance of Linux and the rich and easy-to-use features of the LWP bundle and Perl would make it very easy to extend HTTPPing.pl and Monitor.pl to perform more complex web server checks. You could handle cookies and perform simulated user input into forms periodically to test applications. The possibilities of HTTP client programming are limitless with the LWP modules.


Robb Hill is the Senior Webmaster at the American Red Cross National Headquarters, where he is responsible for the technical aspects of the public and Intranet web servers. If you have questions, he can be reached at vortextube@earthlink.net.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

old info

Sasha Chorny's picture

MIME::Base64 is core from 5.8 and in general installation is more convenient with cpan shell.