jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [docs/] [pages/] [cacti-plugin.html] - Rev 30 Go to most recent revision

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 Weathermap 
v0.91
 - Cacti Plugin</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 Weathermap 
v0.91
</h1>
    <h4>Copyright &copy; 2005-2007 Howard Jones, <tt><a
href="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<a
href="http://www.network-weathermap.com/">Website</a>)</h4>
</div>


      <h2><a name="cactiplugin">Cacti Plugin</a></h2>

<p><img class="figure figright" src="../images/cacti_step2.png" />Since v0.8 there is support for tighter <a href="http://www.cacti.net/">Cacti</a> integration, using the Cacti Plugin Architecture that Jimmy Conner (aka cigamit) has developed for Cacti 0.8.x.</p>
<p class="important">NOTE: To start using the plugin, you should follow the <a href="main.html#installation">installation notes</a> through first.</p>

<p>With that done, you should now have a Weathermap tab showing in your Cacti web interface, and a Weathermaps entry under Management in the Console menu. If you already have your map configuration files, you should now copy those into the 'configs' directory, inside the weathermap directory, so that the plugin can find them. If you don't, there's a complete example map in the weathermap/docs/example directory, that you can use to get started. Copy the example.conf from there into your configs/ directory instead.</p>


<p><img class="figure figright" src="../images/cacti_maps_manage.png" />Once your maps are in the configs directory, choose the 'Weathermaps' 
link from the left side menu of the Console page in Cacti.  A new screen 
appears, showing the configuration files that Weathermap is currently 
handling. Choose 'Add' and pick one of your configuration files from the 
list. </p> 
<p>It should appear in the 'Weathermaps' list now, and you 
can see whether it will be updated on the next poller run ('active'), 
and who will be able to see it.</p> 

<p>At this stage, you should probably wait five minutes (a poller cycle), reload the 
Weathermap tab, and make sure your map was created. If it doesn't show 
up, turn on the regular Cacti DEBUG logging, and wait for the next 
poller cycle to finish. You should get some useful error message from 
Weathermap in the Cacti logs to help you figure out what went 
wrong.</p>

<p>Don't forget to turn DEBUG off again, once you are done, as 
it can quickly take a lot of disk space!</p><p>Most serious errors will 
also show up in the log, even with DEBUG turned off.</p> 

<p>If your map was created OK, then welcome to Weathermap!</p>
<p>The rest of this page is a reference to all the available options in the plugin.</p>

<h3>Managing Maps - Access Control</h3>

<p>Access-control with the 
<img src="../images/cacti_user_manage.png" class="figure figright" /> Weathermap plugin is in two layers. First, you can control who will see 
the Weathermap tab (and the 'Weathermaps' management link) in the usual Cacti way: 
in User Management, give your users the 'View Weathermaps' right. 
Second, you can control <i>which</i> weathermaps that they will see, 
from the Manage Maps page. Click on the link for your new map in the 
column marked 'Accessible By', and you will get a page where you can add 
and remove users from the list who can see this particular map. There is 
one extra user 'Anyone', that matches <i>any</i> authenticated user. 
This is to save you adding new users to a list when you want to have a 
'global' map available to all users.</p> 
<p>The final feature of the Management page is that you can change the order in which the maps are shown, by clicking the Sort Order 
arrows to move them up or down.</p> 

<h3>Viewing Maps</h3>
<p><img src="../images/cacti_mainscreen.png"  class="figure figright" />Since this is what it's really all about - presenting your users with 
nice maps!</p>
<p>Your users can access the maps that they have been allowed access to (see above) by clicking on the Weathermap tab. You will need to give them the right
to View Weathermaps in the User Management page first. The user can choose to cycle between the maps that they can see (if there is more than one). Also note: if you use OVERLIB popup graphs in your maps, your users must have access to view those graphs in Cacti, or they will see a broken image icon instead!</p>

<h3 style="clear:both" >Managing Maps - Display Options</h3>
<p><img src="../images/cacti_wmap_settings.png" class="figure figright" />All of the Weathermap plugin's settings are in the Misc tab of Cacti's Settings page (Console..Settings on the left side menu).</p>
<p><em>Page style</em> gives you two
choices of layout - a big stack of fullsize maps on one page, or a grid of thumbnails, 
each of which leads to a full size map view. From either view, you can also choose the 
Cycle mode. Cycle mode gives you an automatically refreshing page cycling through all the
maps available to you.</p>
<p>If 
you only have one map (or a user is only allowed to see one), then the user will 
get a full-size map regardless of the setting. Also in the settings 
page, you can choose the maximum size of the thumbnails. The Page style setting 
takes effect immediately, but the thumbnail size is used next time the 
maps are generated by the poller.</p>

<p>The last display-related Weathermap setting in the Settings page is the Refresh Time for Cycle mode. You can choose
how long each map stays on-screen for. The default is 'Automatic', which takes the 5 minutes
that the data is valid for (a poller cycle), and divides it evenly between the available maps
- if you had 5 maps, they would each get 1 minute onscreen before the page reloaded with new
 updated maps. <em>This is nothing to do with changing how the Cacti poller works!</em></p>

<h3>Managing Maps - Other Options</h3>

<p><em>Output Format</em> allows you to change the image file format used by the plugin. Since v0.9, Weathermap can create PNG, GIF and JPEG files, as long as the GD library on your system was compiled with the correct libraries. JPEG images can be quite a bit smaller than PNG, without much degradation in quality. PNG is the default.</p>

<p><em>Map Rendering Interval</em> is intended for advanced users only. If you use the <em>1-minute polling</em> patch for Cacti, you might not want to have Weathermap redraw your maps every minute. This option allows you to change this, so that Weathermap only redraws every <em>n</em> polling cycles. </p>
<p>During that one cycle when it does redraw, your polling cycle will still be longer than usual, so you can also turn off the poller part of Weathermap, so that it doesn't redraw at all. This allows you to use the user-access parts of the plugin, but manage the redrawing of maps yourself. To redraw all the maps outside of the standard Cacti poller process, there is a special PHP script <tt>weathermap-cacti-rebuild.php</tt> that does the same job as the Cacti poller. To use this, you need to edit it, and change the path in the top of the file to point to your Cacti root directory. Then set up a second /etc/crontab entry, to redraw your Weathermaps without slowing down your Cacti polling:
<div class="shell"><pre>
*/5 * * * *   cactiuser  /usr/bin/php   /your/cacti/path/plugins/weathermap/weathermap-cacti-rebuild.php
</pre></div>

You will need to change the paths to php and cacti, and the user that cacti runs as. If you use 'crontab -e', instead of editing /etc/crontab directly, then you should remove the 'cactiuser'.
</p>
    
<h3>Final Notes and Troubleshooting</h3>    

<p class="important">Weathermap has quite a lot of logging. If you have a problem, then <em>check your cacti.log</em> for lines starting WEATHERMAP. Most normal errors will
appear in here with Cacti's logging level set to LOW. If you set Cacti's logging level to DEBUG, then Weathermap will produce a <em>lot</em> of log information as it runs. Also see the <a href="faq.html">FAQ section</a> of this manual, and the <a href="http://www.network-weathermap.com/">network-weathermap.com</a> website for more.</p>

<p>On the Weathermap management page, there is a 'Recalculate NOW' button. This will try to recalculate all your maps on demand. This is more complicated than it sounds, due to file permissions! Normally, the Cacti poller would create the images and HTML files in the output directory, which means they are owned by the 'cactiuser', whatever that user is called on your system. When you click 'Recalculate NOW', the redraw process is run from within your webserver, and runs as whatever user runs your webserver (nobody, www, apache...). To allow for both these situations, the output directory and it's contents must have appropriate permissions to allow both users to write to the files. The lazy insecure way to do this is just 'chmod 777 output/*', but that allows <em>everyone</em> to write to the files! A better way is to create a new group, make 'cacti' and 'www' members of that group (as well as their other groups), then 'chgrp -R newgroup output' and 'chmod 770 output/*' so that they can both write, but nothing else can. <strong>This is why the button is labelled 'experimental'.</strong></p>

    </div>
  </div>
</body>
</html>

Powered by WebSVN 2.2.1