Network Weathermap – Network Map Tool
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.
Requirements
- Webserver with PHP support
- rrdtool installed
- php-gd libraries installed
Installation
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
Preparation
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 ./images
directory.
Generation
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
Editing
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:
$ENABLED=true;
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
For generating 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 example.conf
.
Examples
Here are 2 examples of my maps:
More 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.

Hi
Thanks for the write up. would you be able to share your script that snmped your switches to create the text file .
Thanks
Richard
Instead of pasting bunch of different the scripts, which wouldn’t be very useful to you, I’ll explain whole procedure, how I did it on my routers and to give you an idea how can you implement it on your own.
1. I extend SNMP on all edge routers, to export “latency”, “packetloss” and “bandwidth” stats in SNMP. I gather these details by periodically running iperf / mtr from each edge router to another. All edge routers get list of other edge routers from a text file on publicly available webserver, so that I can easily add new edge routers that need to be benchmarked, without the need of modifying scripts on all edge routers.
2. On monitoring server I loop thru the list of edge routers and gather details with snmpwalk:
for HOST in $HOSTS; do
/usr/bin/snmpwalk -v 2c -c mypass $HOST NET-SNMP-EXTEND-MIB::nsExtendOutLine.\"network_quality\" > ${HOST}.file
done
This would create network quality file for each of the edge routers.
3. I create data file from this “host” file, by telling it by hand, which edge routers are interconnected. Example for rttp-rttc edge routers:
echo -n "rttp-rttc"
echo -e -n "\t"
echo -n `cat edge1.file | gawk -F" " {' print $5 '} | cut -d":" -f2` # this is "out" bandwidth
echo -e -n "\t"
echo `cat edge2.file | gawk -F" " {' print $4 '} | cut -d":" -f2` # this is "in" bandwidth
I pipe this into data.txt, which you see in example.zip.
Thanks,
Very good.