Home‎ > ‎unix/linux‎ > ‎Monitoring / Internet Based Tools‎ > ‎Cacti‎ > ‎

Network Weather Map


Network WeatherMap is a fantastic way of providing a "manager overview" of the network.  Generally speaking, you can provide a network diagram, and mark it up showing the heath of nodes or links.  The following is an example of these diagrams, but there are many more at the weathermap gallery.  

This document assumes that you have already installed the weathermap plugin, and now need to configure it.  

Post Install: 

Once the plugin is installed, make sure the output file is write-able:
chown -R cacti /usr/share/cacti/plugins/weathermap/output/
chown -R cacti /usr/share/cacti/plugins/weathermap/configs/
chmod -R a+w /usr/share/cacti/plugins/weathermap/configs

If you don't do this, when you load the editor, the diagram will not be writable, and you wont be able to make any changes.  

There is also a couple of other items that need to be installed on your cacti box to get weathermap to work (specificly GD).  it comes with a nice checking tool that you can use at the following url: 

Creating a Map: 

By default, weathermap will not do any polling by itself, instead, it takes the data that cacti has been monitoring, and presents it in a different format.  So before you start putting together your diagrams, make sure that you are already monitoring everything that you need.  

New Page: 

Create the new file: 

make a duplicate of the "simple" config file, and rename it to what ever you want to have created.  
cp simple.conf 
make sure that your access is setup correctly: 
# ls -lF
total 12
-rw-rw-rw- 1 cacti root 1250 Jun 27 19:15 bosPhy.conf
-rw-r--r-- 1 cacti root 62 Mar 19 2008 index.php
-rw-r--r-- 1 cacti root 1212 Jun 27 18:53 simple.conf

Enable the new file: 

under console(1), Management(2), select Weathermaps(3)

Then select add(1) in the weathermaps main mgmt page

And then select the add(1) button next to your newly created file to make it available for editing/viewing: 

Then to start editing the map, select it(1) back in the main weathermaps mgmt page: 

Moving Nodes

When the new map pulls up, confirm that you can properly modify it by selecting the node1(1)

Select the Move(1) and then a different location on the page.  

If the node does not get moved, then either go back to the shell and confirm the rights are correct on the box, or check that selinux is not the issue.  

New Nodes and Links: 

Placing Nodes: 

Now comes the fun part.  Either modify the current nodes by selecting them(1), or add new nodes(2) and place them on the page.  

in the node properties window (what you get when you select a node(1) from above), you can define the name of the node, its location and it's icon.  

Note in the above example, we also showed how to move the nodes, so by now, you can place all the nodes, change their names and icons, and put them generally where you want them.  

As far as cleaning up and adding cacti data, hold off on that for now... we'll get to that a bit later...  Just get all the nodes placed.  

When you want to save your work, select the Change File(1) button, and it will save the file, and bring you back out to the main weathermap mgmt page.  

Getting icons: 

I have created a couple of icons that you can use, or you can grab tons more from cisco.  if you want to add new icons, then place them in the images directory:

Creating Links: 

The links can simply be made by selecting the add link(1) button and then clicking on the first(2), and then the second(3) object that the link goes between.  When placing links, start with the SOURCE that the graph data uses.  

So if you have a link between switches 1 and 2, and you will track that with switch 1's graphs, then select switch 1 first.  Otherwise the graphs are backwards.  (below in the cleanup section, we will be able to fix backwards graphs if you make a mistake.)

This puts the link in place as such. 

Go on doing this for all the links that you want to monitor.  If there are two or more links, go ahead and place them.  It will be a bit tricky seeing what you are doing as multiple links are placed on top of each other, but go ahead, get everything down.  As I mentioned before, we'll clean up everything in a bit.  

When your done, you get something that looks like this: 


Next we want to move things around so that they are lined up properly, and seperate the multiple links on top of each other so that we can view the diagram better.  

It's *way* easier to do this from the command line rather then the gui, so go ahead and pull up the config file in your favorite editor.  (note that the maps will be in the /usr/share/cacti/plugins/weathermap/configs directory.) 
vim /usr/share/cacti/plugins/weathermap/configs/bosPhy.conf

Grid out the items: 

First thing you want to do is properly place the objects in a nice grid layout.  Look at the config file at the section titled # regular NODEs: and review the POSITION variables.  The POSITION variable lists the y,x coordinates for where each node is placed on the diagram.  Below is a snippet of the node section in this example.  

# regular NODEs:
NODE bos-fw1a
    LABEL bos-fw1a
    ICON images/pix.gif
    POSITION 287 143

NODE bos-fw1b
    LABEL bos-fw1b
    ICON images/pix.gif
    POSITION 698 141

NODE swa02
    LABEL swa02
    ICON images/sw.gif
    POSITION 565 287

NODE swa01
    LABEL swa01
    ICON images/sw.gif
    POSITION 391 266

NODE swa03
    LABEL swa03
    ICON images/sw.gif
    POSITION 393 443

NODE swa04
    LABEL swa04
    ICON images/sw.gif
    POSITION 566 440

Review all the nodes positions, and then look at the diagram, and come up with what the locations should be for all the devices.  I like to create a grid work that are equally spaced, and then modify each of the objects to fit in that gridwork.  

Once you have done that, go back to your config file, and modify the POSITION statements so that all the devices are configured within the grid-work you defined   

As you make the changes to the config file, you can refresh the editor [Ctrl+Shift+r] to see how things line up, and you can make modifications to your plans as needed.  

When its all said and done, you'll end up with something pretty like this: 

The placement of the nodes are good, but now we need to modify the links so that you can see the multiple links between the same nodes.  

Space out the links: 

Here we go back to the config file and look at the # regular links section.  I like to mark mine up a bit so that I can find where everything is.  The comments all start with a # in the front.  

# ---------------------------------------------------
# regular LINKs:

# firewalls:

LINK node1-node2
TARGET static:10M:20M
NODES bos-fw1a bos-fw1b

LINK swa01-bos-fw1a
NODES swa01 bos-fw1a

LINK swa01-bos-fw1aa
NODES swa01 bos-fw1a

LINK swa01-bos-fw1aaa
NODES swa01 bos-fw1a

LINK node2-node3
NODES swa02 bos-fw1b

LINK bos-fw1b-swa02
NODES swa02 bos-fw1b

LINK swa02-bos-fw1b
NODES swa02 bos-fw1b

# switches:
LINK swa01-swa02
NODES swa01 swa02

LINK swa01-swa02a
NODES swa01 swa02
In the example above, the second and third LINK lines go between the same nodes, and thus are on top of each other.  There are a couple of different ways to offset the start point of the links, I like the radial method, but you can look at the config reference for the entire list of options.  

The radial coordinates is using the compass coordinates with 0=up, 90=right, 180=down, and 270=left.  

the format is {node}:{degrees}r{offset}

So the following LINK statement: 

LINK swa01-bos-fw1a
    NODES swa01:60r20 bos-fw1a:60r20

LINK swa01-bos-fw1aa
    NODES swa01:240r20 bos-fw1a:240r20

LINK swa01-bos-fw1aaa
    NODES swa01 bos-fw1a

Creates the three parallel links between the firewall and the switch: 

Go through your config and offset all the links so that they are view able in the diagram.  The end result would be like such.  

The other thing we can do related to the links is modify the font size so that the bandwidth readings are a bit smaller.  In the config file, modify the BWFONT setting from 100 to 1

    WIDTH 5
    BWFONT 1
    BWLABEL bits

Populate Data into the Links: 

The final thing to do is select what cacti data point should be tracked for each link.  This is easiest to do within the weathermap editor.  

Select a link(1) in the editor

and in the Link Properties window, under Data Source(1) select the Pick from Cacti(2) button

and then scroll down till you find the correct item for this, and select(1) it.  

An then back in the Link Properties window, enter in the links Maximum Bandwidth(3) so that the link is properly color coded, and then select Submit.  

Repeat this for all the links, and then make sure you press the Change File(1) button to save the changes you just entered.  

Chuck M,
Jun 27, 2012, 1:21 PM