| Home Profile Fun |
#183 Linux 04.07.2009
The Weathermap Plugin of CactiOverview Official documentation and download First steps Configuration Usage Additional hints Summary Overview The Weathermap Plugin allows the graphical presentation of the load between different nodes of a network. What is very special is that you are not bound to any structure. You can create the graphs almost like in a painting program. With the standard snmp interface statistiks of Cacti you get only the traffic per network interface. This means you cannot visualize the traffic between hosts, just between a hosts IP and the port on the switch. If you want this data per host you have to create your own solution for that. Some devices support this, keywords are sflow, ipfix or netflow. Official documentation and download Homepage Weathermap Documentation Weathermap Download Diagram which shows how the directives change the graphs Reference for the directives Include the host status Some very beautiful example weathermaps: http://www.network-weathermap.com/node/51 http://forums.cacti.net/about24433.html First steps, Screenshot 1 The default configuration does not need to be changed at the beginning. You can go directly to console → Management → Weathermaps. Here you find an example weathermap, the configuration file for it respectively (simple.conf). It contains some static values. If you click on the file name you get to the weathermap editor. This is very cool because you can now change the content of the configuration file just by clicking. Down on the right side is a link "See config" which shows the content of the configuration file. On the upper left side there is a button "Change File" which brings you back to Cacti. Then you can view the result on the tab weathermap. Configuration, Screenshot 2 The basic configuration is done in: Console –> Settings → Misc → Network Weathermap The Weathermaps can be created or changed in: Console → Management → Weathermaps There you can select a configuration file for a weathermap and change it or you can use the link "Weathermap Editor" below the table to create a new file or a copy of an existing file. If you have used the Weathermap editor to create a new weathermap you have to use "Add" to add it to the list. There seem to be some issues with file permissions. If necessary just correct the rights on the command line so that the files belong to the user of the web server. The Weathermap editor in Cacti is a front-end for the configuration files. For every weathermap such a configuration file is needed which contains all necessary information to generate the map. You can always change these values directly with a text editor. If you want to use some of the advanced features of weathermap in Cacti you even have to do this. The great thing about the editor is that you can click your maps together without being forced into some structure. Only your creativity is the limit. Some notes for the most important configuration directives: NODE: host, switch, router, etc. LINK: Link between nodes BANDWIDTH: means maximum bandwith and represents bits per second. But you can also use K,M,G,T for large values TARGET : the data source for a link wich is an rrd file in Cacti INFOURL: a hyperlink to the graphs in Cacti which belong to this link OVERLIBGRAPH: displays a graph if you move the mouse over the link Important: the order of the nodes in the NODES line of link is important. If you create a link in the editor by clicking first host1 and then host2 you have to chose the rrd file which belongs to host1. And the nodes line must start with host1 followed by host2. You can select the correct rrd file for a node in the editor wich makes it very convenient. To use the plugin you can use the rrd files which have been created by data templates which are based on the data query "SNMP - Interface Statistics" Usage, Screenshot 3 The weathermaps are being generated dependent on the Cacti poller cycle. On each map you can see the date and time when the map has been created. There is a button which allows you to force the generation immediately. But the result is that the file permissions of the maps are wrong and the automatic generation does not work any more. The manual generation can still be used but if you want it to be done by the poller you have to fix the permissons. The folder output has to look like this. If you have existing weathermaps there just change their owner back to the user of the web server. # cd /var/www/html/plugins/weathermap/output/ # ls -lha total 36K drwxr-xr-x 2 apache apache 4.0K Jun 23 16:36 . drwxr-xr-x 9 apache apache 4.0K Apr 14 05:40 .. -rwxr-xr-x 1 apache apache 0 Apr 14 05:40 dummy-file.delete-me -rwxr-xr-x 1 apache apache 33 Apr 14 05:40 .htaccess -rwxr-xr-x 1 apache apache 62 Apr 14 05:40 index.php You can also generate weathermaps from the command line. This is independent from Cacti: # php ./weathermap --config myconfigfile.conf --output mymap.png --htmloutput mymap.html Additional hints What exactly is the meaning of the values of a link actually? x% The most current value of the rrd file (the value from the last poller run) is used. This value is compared with the BANDWIDTH value of the link (as percentage). It is the current load of the network as percentage in bits per second. (Because of rrdtool it is not the real value but a consolidated value as always in Cacti). Summary A really great plugin which gives the user endless possibilities in creating and designing his own network weatermaps. Although it is mainly used to present the load of a network it can be used to present any data which can be stored in rrd files (or other data sources, see the Weathermap documentation). Nagios and Cacti Cacti Training |