jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [docs/] [pages/] [targets.html] - Blame information for rev 41

 

Line No. Rev Author Line
11simandl<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 
4<html lang="en" xml:lang="en">
5<head>
6 <link rel="stylesheet" type="text/css" media="screen" href="weathermap.css" />
7 <meta name="generator" content=
8 "HTML Tidy for Mac OS X (vers 12 April 2006), see www.w3.org" />
9 
10 <title>PHP Weathermap
11v0.91
12 - Changes For This Version</title>
13<style type="text/css" media="print">
14/*<![CDATA[*/
15body { font-size: 12pt; }
16a { color: black; text-decoration: underline; font-weight: normal;}
17/*]]>*/
18</style>
19 
20</head>
21 
22<body>
23 <div id="frame">
24 
25 
26<div class="navcontainer">
27 <ul id="navlist">
28 <li><a href="main.html">Main Page</a></li>
29 <li><a href="main.html#installation">Installation</a></li>
30 <li><a href="main.html#basics">Basics</a></li>
31 <li><a href="faq.html">FAQ and Tips</a></li>
32 <li><a href="main.html#example">Sample Map</a></li>
33 <li><a href="cli-reference.html">CLI Reference</a></li>
34 <li><a href="config-reference.html">Config Reference</a></li>
35 <li><a href="advanced.html">Advanced Topics</a></li>
36 <li><a href="editor.html">Editor</a></li>
37 <li><a href="cacti-plugin.html">Cacti Plugin</a></li>
38 <li><a href="http://www.network-weathermap.com/">Site</a></li>
39 </ul>
40</div>
41 
42<div id="header">
43 <h1>PHP Weathermap
44v0.91
45</h1>
46 <h4>Copyright &copy; 2005-2007 Howard Jones, <tt><a
47href="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<a
48href="http://www.network-weathermap.com/">Website</a>)</h4>
49</div>
50 
51 
52 <h2><a name="targets">Specifying <a href="config-reference.html#LINK_TARGET">TARGET</a> lines</a></h2>
53 
54<p>The actual data-reading part of Weathermap is handled by Data Source Plugins since version 0.9. These allow users or third-parties to easily add new data sources into Weathermap without altering the core code.</p>
55<p>There are a number of plugins supplied as standard, which will be described here. Each one uses a different format of <a href="config-reference.html#LINK_TARGET">TARGET</a> string, which contains the parameters the plugin needs to find your data. <em>All</em> plugins return an 'in' and 'out' value, and some may set other variables that can be accessed by <a href="advanced.html#tokens">Special Tokens</a> in strings. For situations where there is only really one output, the 'out' value may just be the same as the 'in'.</p>
56 
57<p>Here are the details of the standard data source plugins:</p>
58 
59<hr />
60 
61<h3><a name="static"></a>Static value</h3>
62 
63<div class="definition">TARGET static:<em>invalue</em>:<em>outvalue</em></div>
64<div class="definition">TARGET static:<em>value</em></div>
65 
66<p>The simplest of all the plugins, static allows you to just set a value in the config file itself. Sometimes this is useful for testing, or simple maps of things like OSPF metrics. If only a single value is specified, it is used for <em>both</em> input and output, just like the <a href="config-reference.html#LINK_BANDWIDTH">BANDWIDTH</a> parameter.</p>
67 
68<p>The values in the target string can use the same K,M,G,T suffixes as BANDWIDTH.</p>
69 
70<h3><a name="rrd"></a>RRDtool files</h3>
71 
72<div class="definition">TARGET <em>rrdfile.rrd</em>:<em>in_ds</em>:<em>out_ds</em></div>
73<div class="definition">TARGET gauge:<em>rrdfile.rrd</em>:<em>in_ds</em>:<em>out_ds</em></div>
74<div class="definition">TARGET rrd:<em>rrdfile.rrd</em>:<em>in_ds</em>:<em>out_ds</em></div>
75 
76<p>This is the 'core' plugin for Weathermap. It reads data from rrd files, created using <a href="http://www.rrdtool.org/">Tobi Oetiker's RRDtool</a>, by tools like Cacti, MRTG, Cricket, NRG and so on.</p>
77 
78<p>If you only specify a filename, and no DS-names, the default DS names for RRD files are 'traffic_in' and 'traffic_out', which works with
79 the majority of Cacti RRD files. For MRTG-produced RRD files, the names are
80 'DS0' and 'DS1'.
81 </p><p>You can also specify '-' for either DS name, which tells Weathermap to ignore
82 this rrd file for the purposes of the input or output value.
83 This is mainly useful in combination with the aggregation feature, where you can take the input data from one rrd file, and the output data from another.</p>
84 <p>With no prefix, or with just 'rrd:' as a prefix, the data read from the rrd file is assumed to be a standard SNMP interface counter, which is a byte-rate. It automatically multiplies these by 8 to get a bit-rate for the map. With the 'gauge:' prefix, this multiplication doesn't happen, which is useful for non-bandwidth values, like SNR or session-counts.</p>
85 
86<p>By default, the plugin will read the last 800 seconds of data, and find the most recent within that to use. You might need to make it read back further, if you are updating your rrd files slowly. You can do this with the <a href="config-reference.html#GLOBAL_SET">SET</a> command, by adding <a href="config-reference.html#GLOBAL_SET">'SET</a> rrd_period 3000' (any value in seconds) at the top of your map config file, before any <a href="config-reference.html#NODE_NODE">NODE</a> or <a href="config-reference.html#LINK_LINK">LINK</a> lines.</p>
87<p>Similarly, you can change the time that the plugin looks for data at from the present to the past, by using <a href="config-reference.html#GLOBAL_SET">'SET</a> rrd_start -1d' in the top section of the config file. The full range of time-specification strings is at the bottom of the <a href="http://oss.oetiker.ch/rrdtool/doc/rrdfetch.en.html">rrdfetch manual page</a>.</p>
88 
89<h3><a name="tabs"></a>Tab-separated text</h3>
90<div class="definition">TARGET <em>textfile</em></div>
91 
92 <p>For tab-delimited data files, the format is plain-text, with three tab-seperated columns.
93 The first one is a linkname, and the second and third are traffic-in and traffic-out, respectively.
94 The linkname should match the name in the configuration file. This allows you to create one text file
95 for the entire map from some outside source. Traffic in &amp; out values can use the same "K,M,G,T" abbreviated forms
96 as the <a href="config-reference.html#LINK_BANDWIDTH">BANDWIDTH</a> configuration command. The file should have an extension of .txt or .tsv to be
97 recognised as a tab-delimited file by Weathermap.</p>
98 
99 
100<h3><a name="mrtg"></a>MRTG .html file</h3>
101<div class="definition">TARGET <em>htmlfile</em></div>
102 
103<p>This plugin reads data from special comments in the HTML files generated by MRTG. This is intended mainly for people using the 'old-style' MRTG .log files. If you are using MRTG with an RRDtool backend, then it's probably better to use the RRDtool plugin. </p>
104<p>The file should have an extension of .html or .htm to be
105 recognised as an MRTG file by Weathermap.</p>
106 
107<h3><a name="cactihost"></a>Cacti host status</h3>
108<div class="definition">TARGET cactihost:<em>hostid</em></div>
109 
110<p>This plugin reads the current status of a host from your Cacti database. The hostid is visible in Cacti URLs when you click on links in the Devices page. The return values for this plugin are numeric codes. It also sets a Hint Variable called 'state' to a string, that can be nicer to use in an <a href="config-reference.html#NODE_ICON">ICON</a> filename, for example</p>
111<table>
112<thead><tr><th>Code</th><th><tt>state</tt> value</th></tr></thead>
113<tbody>
114<tr><td>0</td><td>disabled</td></tr>
115<tr><td>1</td><td>down</td></tr>
116<tr><td>2</td><td>recovering</td></tr>
117<tr><td>3</td><td>up</td></tr>
118</tbody>
119</table>
120 
121<p>An appropriate <a href="config-reference.html#GLOBAL_SCALE">SCALE</a> definition to get red, green, yellow and grey labels based on the state of a host would be:
122<pre>SCALE cactiupdown 0 0.5 192 192 192
123<a href="config-reference.html#GLOBAL_SCALE">SCALE</a> cactiupdown 0.5 1.5 255 0 0
124<a href="config-reference.html#GLOBAL_SCALE">SCALE</a> cactiupdown 1.5 2.5 0 0 255
125<a href="config-reference.html#GLOBAL_SCALE">SCALE</a> cactiupdown 2.5 3.5 0 255 0 </pre>
126</p>
127 
128<h3><a name="snmp"></a>SNMP value</h3>
129 
130<div class="definition">TARGET static:<em>invalue</em>:<em>outvalue</em></div>
131 
132<p>This is a fairly experimental plugin. It requires the PHP snmp extension to be installed and enabled. Even then, it's hit & miss whether it will work on a particular system - some versions of PHP have better support for SNMP than others, and on some platforms it is different to others, too.</p>
133<p>This plugin can directly query an SNMP-manageable device and fetch an OID from it.</p>
134 
135<h3><a name="script"></a>External script</h3>
136 
137<div class="definition">TARGET !<em>scriptname</em></div>
138 
139<p>This plugin is fairly experimental and not thoroughly tested.</p>
140<p>This plugin allows you to write small external scripts, and pass the value from the script into Weathermap. The output format of the script is the same one that MRTG uses for <em>it's</em> external scripts, so it's possible that you can even find an existing script to do what you want, somewhere else.</p>
141 
142 </div>
143</body>
144</html>

Powered by WebSVN 2.2.1