![]() ![]() |
weathermap |
Subversion Repositories: |
Compare with Previous - Blame - Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en"><head><link rel="stylesheet" type="text/css" media="screen" href="weathermap.css" /><meta name="generator" content="HTML Tidy for Mac OS X (vers 12 April 2006), see www.w3.org" /><title>PHP Weathermapv0.91</title><style type="text/css" media="print">/*<![CDATA[*/body { font-size: 12pt; }a { color: black; text-decoration: underline; font-weight: normal;}/*]]>*/</style></head><body><div id="frame"><div class="navcontainer"><ul id="navlist"><li><a href="main.html">Main Page</a></li><li><a href="main.html#installation">Installation</a></li><li><a href="main.html#basics">Basics</a></li><li><a href="faq.html">FAQ and Tips</a></li><li><a href="main.html#example">Sample Map</a></li><li><a href="cli-reference.html">CLI Reference</a></li><li><a href="config-reference.html">Config Reference</a></li><li><a href="advanced.html">Advanced Topics</a></li><li><a href="editor.html">Editor</a></li><li><a href="cacti-plugin.html">Cacti Plugin</a></li><li><a href="http://www.network-weathermap.com/">Site</a></li></ul></div><div id="header"><h1>PHP Weathermapv0.91</h1><h4>Copyright © 2005-2007 Howard Jones, <tt><ahref="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<ahref="http://www.network-weathermap.com/">Website</a>)</h4></div><div class="license"><p>PHP Weathermap is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p><p>PHP Weathermap is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with PHP Weathermap; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p><p>Parts of this software distribution are by other authors. Please see the README file for attribution and license details.</p></div><div id="enclose"><div class="card-right" style="width: 290px;"><h2 class="card-title">PHP Weathermap</h2><p class="card-photo"><img src="../images/weathermap-mini.png" /></p><p class="card-desc">Sample output from php-weathermap, using data collected by Cacti and MRTG.<br /><a href="../images/weathermap-example.png">Larger version</a></p></div><h2><a name="introduction" id="introduction">Introduction</a></h2><p>PHP Weathermap is one of <a href="#alternatives">many</a> implementations of the same basicidea - take data from your network devices and use it toprovide a single-page overview of the current state ofnetwork, like the one to the right. It complements a toollike <a href="http://www.mrtg.org">MRTG</a>, <a href="http://cricket.sourceforge.net/">Cricket</a> or <a href="http://www.cacti.net/">Cacti</a>, that provide in-depthgraphing, and historical information, and can use data fromthose systems to produce it's maps. In fact, it<i>requires</i> some other data-collection source, as it doesno device-polling on it's own.</p><p>This particular version is written in PHP, and it can read statistics data fromMRTG-produced HTML files, plain tab-seperated text files and from RRD files, such as thoseproduced by newer MRTG setups, Cacti (my favourite) oranother tool. It can also generate HTML 'holder' files forthe map images, which can include 'DHTML' overlays ofhistorical data and links into your othermonitoring/statistics system. It also has a interactive map editor, so you can largely avoid the text configuration files, if you prefer.</p><p>To get a better idea of what is possible, see the <a href="#example">example map</a> that comes with this manual.</p><h3>Requirements</h3><p>Based on lessons learned with the perl version, this onehas a very restricted set of dependencies - you'll need arecentish PHP (>4.3.0 I think) including the CLI versionand the 'gd' extension with PNG, TrueColour and FreeType support. You will need command-line (<i>aka shell/ssh/telnet</i>) access tothe server which will host the maps.<p>To read RRD files, you'll need the rrdtool command-line program. </p><p>Apart from thegd module, these requirements are the same as for Cacti,which is the most-tested partner stats system.</p><p>To use the Cacti plugin, you will need a recent version of Cacti, and the matching Cacti Plugin Architecture, from <a href="http://cactiusers.org/">Jimmy Conner's Cactiusers.org</a>.</p><h2><a name="support">Support</a></h2><p>There are two mailing lists for php-weathermap:<dl><dt>php-weathermap@thingy.com</dt><dd>General discussion of weathermap-related issues, bug reports and development. Fairly low traffic currently. Typically contains discussion of test or beta versions too, when they are circulating.</dd><dt>php-weathermap-announce@thingy.com</dt><dd>Very low volume list for new version announcements and other similarly rare events!</dd></dl>More information about how to subscribe to the mailing lists is <a href="http://www.network-weathermap.com/support/mailinglists">at the website</a>.</p><p>Also, if you have an RSS reader, you can subscribe to the <a href="http://www.network-weathermap.com/appcast.rss">'appcast' feed for php-weathermap</a> which contains roughly the same content as the -announce mailing list.</p><h2><a name="installation" id="installation">Installation Guide</a></h2><p>How to install Weathermap depends on how you intend to use it:<ul><li><a href="install-cacti-editor.html">As a Cacti Plugin, with the web-based editor</a></li><li><a href="install-cacti.html">As a Cacti Plugin</a></li><li><a href="install-cli-editor.html">As a standalone command-line tool, with the web-based editor</a></li><li><a href="install-cli.html">As a standalone command-line tool</a></li></ul></p><h2><a name="running" id="running">Running Weathermap</a></h2><p>There are two ways to run Weathermap.</p><p>If you are using the Cacti plugin, then it will be runfor you as part of the Cacti poller cycle. You don't need to do anything special apart from addyour map configuration files, as explained in the <a href="cacti-plugin.html">Cacti plugin</a> notes.</p><p>If you are using weathermap as a standalone tool, you do it using the command line version. See the<a href="cli-reference.html">CLI Reference</a> for all possible options, but a good starting point is something like:</p><div class="shell"><pre>php ./weathermap --config myconfigfile.conf --output mymap.png --htmloutput mymap.html</pre></div><p>You can skip the htmloutput and output parts if you have HTMLOUTPUTFILE and IMAGEOUTPUTFILE lines in your configuration file.</p><p>Usually, people want to run weathermap regularly (it's not a requirement though!). To do that, you need to create a 'cron job' or 'Task Scheduler Task' torun a command-line like the one above on a regular basis. You probably already have a similar task setup to collect the datathat weathermap is reading. This is the same kind of thing.</p><h2><a name="basics" id="basics">Basics</a></h2><p>The weathermap is defined by a plain-text filewhich by default is called weathermap.conf (you can have manyconfigurations, and choose between them with command-line switches).By default, weathermap will read that file, and produce asingle PNG file called weathermap.png.</p><p>The configuration file has three sections: Node definitions, Linkdefinitions and Global settings. There is an <a href="#example">example of a complete file</a> at the bottom ofthis page.</p><h3>Nodes</h3><div class="shell"><pre>NODE nycore1LABEL NYCPOSITION 30 30</pre><b>A simple NODE</b></div><p>Nodes are the points on your network that are joinedtogether. Depending on the detail in the map, they might becities or individual routers. In a basic map, a node has 3pieces of information - an internal name which must be uniqueto this node, it's position from the top-left corner of themap, in pixels, and optionally a label, which will appearwithin the box marking the position of the node. Nodeswithout a label don't appear on the map at all, but can stillbe used as an endpoint for a link.</p><h3>Links</h3><div class="shell"><pre>LINK backbone1NODES nycore1 paix1BANDWIDTH 3MTARGET ../my-mrtg-data/backbone1.html</pre><b>A simple LINK</b></div><p>Links are the network routes between the Nodes.Typically they are actual network links, but they can beanything that you can get numbers for that make sense on map.</p><p>An absolute minimal link has 3 pieces of information too.They are the unique internal name for this link, and uniquenode names for the two endpoints. To show current usage onthe map, you'll need to give two more pieces: the maximumbandwidth on the link, and a way to get the currentthroughput. The BANDWIDTH is measured in bits/sec, and caninclude the usual K,M,G and T suffixes for large values. Thedata-source is given in the TARGET line, and can be one of<ul><li>MRTG-generated HTML file (which contains a special HTMLcomment at the bottom with the current values)</li><li>Cacti-generated RRD file</li><li>Some other RRD file, provided you know how it isstructured internally.</li></ul> One important note: the order of the nodes in the NODESline is significant. The first node is considered to be the'local' one when thinking about the data source in theTARGET. 'out' will be 'out' relative to the first node. Ifyou find the map shows all your data flowing in the wrongdirection, try swapping the order of the nodes here.</p><h3>Global Settings</h3><p>These settings usually live at thetop of the text file, and specify basic information about themap. The minimum settings are:</p><div class="shell"><pre>WIDTH 800HEIGHT 600</pre></div><p>This is specifies the size of the map in pixels. If youwant something a bit fancier than a plain white background,you can make up a background image to use in PNG format. Inthat case, the map will be the size of the background image:</p><div class="shell"><tt>BACKGROUND western-europe.png</tt></div><p>There are also settings to set which fonts and colours are used for variouselements of the map, where to position the colour-legend (if at all), what filesto output, and more advanced layout techniques. The full list is in the <a href="config-reference.html">Config Reference</a>.</p><h2><a name="example" id="example">A SampleConfig</a></h2>Here's a sample configuration, and <a href="../example/example.html">here's what it produces (modified to work a little better)</a>. The dataisn't live in the output, but it gives you an idea of whatcan be done. The initial background image is <a href="../example/background.png">here</a>. The configuration file is also in the docs directory of the distribution, should you want it.<div class="shell"><pre># some initial comments...## This sample configuration file demonstrates most of the basic features of# PHP Weathermap, along with some of the cosmetic and layout changes possible##BACKGROUND background.pngHTMLOUTPUTFILE example.htmlIMAGEOUTPUTFILE example.pngTITLE Network OverviewHTMLSTYLE overlibKEYPOS 10 400# define some new TrueType fonts - built-in ones go from 1 to 5, so start highFONTDEFINE 100 VeraIt 8FONTDEFINE 101 Vera 12FONTDEFINE 102 Vera 9KEYFONT 102LINK DEFAULTBANDWIDTH 100MBWLABEL bitsBWFONT 100OVERLIBWIDTH 395OVERLIBHEIGHT 153WIDTH 4NODE DEFAULTLABELFONT 101NODE transitPOSITION 400 180LABEL TRANSIT# a little splash of background colour for these nodesNODE isp1POSITION 250 100LABEL ISP1INFOURL http://www.isp1.com/support/lookingglass.htmlLABELBGCOLOR 255 224 224NODE isp2POSITION 550 100LABEL ISP2INFOURL http://www.isp2.net/portal/LABELBGCOLOR 224 255 224NODE corePOSITION 400 300LABEL coreINFOURL https://core.mynet.net/admin/NODE customer1LABEL xy.comPOSITION 150 370NODE customer2LABEL ww.co.ukPOSITION 250 450NODE infraLABEL INFRASTRUCTUREPOSITION 450 450# this node has an icon, and so we push the label to the South edge of it, so it# can still be readNODE syncLABEL SyncICON my_router.pngLABELOFFSET SLABELFONT 2POSITION 550 370# the icon is taken from a Nagios icon pack:# http://www.nagiosexchange.org/Image_Packs.75.0.html?&tx_netnagext_pi1[p_view]=110&tx_netnagext_pi1[page]=10%3A10NODE site1LABEL site1POSITION 700 220NODE site2LABEL site2POSITION 750 420LINK sync-coreNODES sync coreTARGET data/sync_traffic_in_259.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=256&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=256## Site1 has two E1s, so we use NODE-offsets to allow them to run parallel#LINK sync-site1aNODES sync:N site1:WWIDTH 3TARGET data/sync_traffic_in_257.rrdBANDWIDTH 2MOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=254&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=126LINK sync-site1bNODES sync:E site1:SEWIDTH 3OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=255&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=TARGET data/sync_traffic_in_258.rrdBANDWIDTH 2MINFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=56## site2 also has two links, but this time we use the VIA to curve the links#LINK sync-site2aNODES sync site2WIDTH 3VIA 650 380TARGET data/sync_traffic_in_251.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=248&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300BANDWIDTH 1MINFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=252LINK sync-site2bNODES sync site2WIDTH 3VIA 650 420TARGET data/sync_traffic_in_252.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=228&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300BANDWIDTH 1MINFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=561## ISP 1 has a several links, again, but they prefer to see one arrow, and the aggregate bandwidth# so we use multiple TARGETs on one line, here, to sum the dataLINK transit-isp1NODES transit isp1TARGET data/trans1_traffic_in_352.rrd data/trans1_traffic_in_378.rrd data/trans1_traffic_in_420.rrdBANDWIDTH 10MOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=355&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=633LINK transit-isp2NODES transit isp2TARGET data/trans1_traffic_in_438.rrdBANDWIDTH 34MOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=433&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=265LINK core-transitNODES transit coreTARGET data/trans1_traffic_in_350.rrdARROWSTYLE compactWIDTH 4OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=347&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=122LINK cust1-coreNODES customer1 coreTARGET data/extreme_traffic_in_299.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=296&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=237LINK cust2-coreNODES customer2 coreTARGET data/extreme_traffic_in_286.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=283&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=222LINK infra-coreNODES infra coreTARGET data/extreme_traffic_in_294.rrdOVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=291&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=228</pre><b>A Sample Configuration File</b></div><h3><a name="alternatives" id="alternatives">OtherWeathermaps</a></h3><p>Obviously, you can't please everyone, sohere's a list of other weathermap or network visualisationimplementations that I know of. Some are open source, somearen't. All of them have some subtle or interesting wrinklethat the others don't. <a href="mailto:howie@thingy.com">Letme know if you know of any others</a>.<dl><dt><a href="http://netmon.grnet.gr/weathermap/" class="ext">GRNET perl version</a> by Panagiotis Christias.</dt><dd>Support only for MRTG, or anything else that canproduce similar HTML files.</dd><dt><a href="http://wotsit.thingy.com/haj/cacti-weathermap.html">My ownperl weathermap</a></dt><dd>A forked/modified version of the GRNET one above, addsimagemaps, DHTML, RRD-reading and a number of smallertweaks. No longer updated.</dd><dt><a class="ext" href="http://weathermap4rrd.tropicalex.net/">Weathermap4RRD</a></dt><dd>Another fork of the GRNET perl map. Also with (only?)RRD support, and various graphical enhancements.<i>Also</i> now with a PHP version!</dd><dt><a href="http://loadrunner.uits.iu.edu/weathermaps/abilene/" class="ext">Indiana University Abilene Weathermap</a></dt><dd>Another perl (i think) script, but with a ratherdifferent map design. Can show error rates on links,too.</dd><dt><a href="http://noc.asti.dost.gov.ph/docus/tools/how-to/weathermap.php"class="ext">PREGINET Network Weathermap</a></dt><dd>Another perl open source map. Works by reading MRTGlogs, as far as I can tell.</dd><dt><a href="http://www.it.teithe.gr/~v13/">V13 netmap</a>(click 'netmap' in the left hand panel - I loveframes)</dt><dd>Similar output to this program, but does all it's ownSNMP data collection.</dd></dl></p></div></div></body></html>