Recently I came across a neat program written in PHP, called Network Weathermap (http://network-weathermap.com). It helps you with drawing a network map and shows live data on it. I never seen it before, although it’s been around for quite a while. I decided to post a tutorial of it because there are still people out there that don’t know about it.
- Webserver with PHP support
- rrdtool installed
- php-gd libraries installed
Installation is quite straightforward. I installed the old version from the website 0.97c, but you can get a newer version with bootstrap and jquery on GitHub (https://github.com/howardjones/network-weathermap). It does need some additional installation of libraries, but for my proof of concept, I’ll use the old one.
Grab it here: http://network-weathermap.com/files/php-weathermap-0.97c.zip and put it in your web directory.
After successful extraction, you should visit: http://mywebserver/weathermap/check.php and ensure everything there is green. Make sure you chmoded
./configs directory, so that webserver can write to it.
My example map
Here’s zip file of example files: example.zip
You should put example.conf into
./configs directory, data.txt into weathermap’s root directory and host.png to
Go to root directory and let’s generate a first weathermap:
./weathermap --config configs/example.conf --output=example.png --htmloutput example.html
Voila! You have your own network map, generated and filled from data in
data.txt. Access it on: http://mywebserver/weathermap/example.html
Now let’s get a little bit into weathermap itself. As you can see config has few sections, one for nodes, and one for links. To create nodes and links I would suggest you using editor that comes with the software. To enable editor edit
./weathermap/editor.php on 4th line:
Now we have an editor in place and we can reach it on http://mywebserver/weathermap/editor.php. Choose
example.conf to open my example config for customization.
Pushing of data
There are several ways to push data to the weathermap:
- RRD file
- Simple text file
- SNMP Oid
- Custom script
I found out, that generating a simple text file with all necessary data to plot is the easiest. (One aggregated data file for all data sources – great for automation.)
RRD is useful if you put this weathermap on cacti server, so it can access local rrd files. See more options for TARGET parameter on: http://network-weathermap.com/manual/0.97b/pages/targets.html
data.txt file I simply wrote a script that SNMP walked my edge routers and generated a
data.txt file. If you open the file, you will see each router connection is represented as:
<link name> <in traffic> <out traffic>
The <link name> should match the link name in
Here are 2 examples of my maps:
If you run out of ideas, see: http://forums.cacti.net/viewtopic.php?f=16&t=24433&start=180 for more suggestions on what kind of maps you can create.