Network Mapping at a Glance, Part 6
Doing it visually with your own Perl script.
by Kent Cearley
Limitations and Extensibility
While ping is useful for testing basic connectivity, it's not always the most reliable mechanism. If a network becomes very congested, routers sometimes throw ping packets away, and some nodes may ignore them; other routers may not be able to respond in time, especially if they are being heavily utilized. Nevertheless, ping is one of the most common tools employed to check the status of a network node, and WebView assists in automating the process.
You can extend this application's minimal framework in a number of ways. For performance, you could store the network map in GD's native format, saving the conversion step; you'll need to make use of GD's read and write methods for this. Instead of ping, you could use SNMP (Simple Network Management Protocol) with routines from either the CMU or Trickle distributions. SNMP would let you query for more sophisticated information on the node. You can add Netscape extensions, such as a client pull that will poll the network every two minutes via a <META> tag in the WebView page:
<HTML>
<META HTTP-EQUIV="Refresh" CONTENT=120>
You can also use your network monitor to check for more sophisticated information. You can check to see if the DNS is working, if your e-mail is functioning, or if your Oracle database is still alive online. Each of these services could be represented graphically as a node, so malfunctioning services can be spotted at a glance.
How to Install fping
Fping was written by Roland J. Schemers III and is currently maintained by Bob Morgan; it can be obtained from ftp://networking.stanford.edu/pub/fping/fping-2.0.tar.gz.
Once compiled and installed on your system, the program can batch ping requests to an unlimited number of hosts specified on its command line. The pings are sent in round-robin fashion, with hosts removed from the list as replies are received. This provides more functionality than the ping available on standard Unix operating systems.
Another kind of ping you could rig to this project is available as a module with Perl 5. But this version is not a true ping; instead, it opens a TCP echo port connection to a host. Many routers and other low-level network devices don't implement TCP echo services, so this may not be generally applicable to a procedure like WebView.
Using GD.pm
GD.pm is a wrapper in the form of a Perl module written by Lincoln Stein. It encapsulates calls to the GD library, which is a set of callable C routines written for creating and manipulating images. GD was written by Thomas Boutell and was designed to be sort of a programmer's toolbox for graphics, including routines for clipping, brushes and line styles, fonts, transparency, and interlaced images. Besides Perl and C, it works with Tcl and simple interpreters written around GD itself (e.g. gdit, tgd, and fly). If you want to create inline images on-the-fly, GD.pm and the GD libraries should be an important part of your CGI toolkit.
GD.pm can be obtained from http://www-genome.wi.mit.edu/ftp/pub/software/
WWW/GD.html and the prerequisite GD library from http://siva.cshl.org/gd/gd.html.
Kent Cearley works in Networks and Distributed Systems at the University of Colorado, Boulder and is author of Interactive HTML3, to be published this spring by Macmillan. He can be reached on the Internet at
http://www.grasshopper.com or via e-mail at
cearley_k@wizard.colorado.edu.
colorado.edu.
Reprinted from Web Developer® magazine, Vol. 2 No. 1 Spring 1996 (c) 1996 internet.com Corporation. All rights reserved.
Web Developer® Site Feedback
Web Developer®
Copyright © 2000 internet.com Corporation. All rights reserved.