weathermap |
Subversion Repositories: |
Rev 1 | Rev 85 | |
---|---|---|
Line 6... | Line 6... | |
<link rel="stylesheet" type="text/css" media="screen" href="weathermap.css" /> |
<link rel="stylesheet" type="text/css" media="screen" href="weathermap.css" /> | |
<meta name="generator" content= |
<meta name="generator" content= | |
"HTML Tidy for Mac OS X (vers 12 April 2006), see www.w3.org" /> |
"HTML Tidy for Mac OS X (vers 12 April 2006), see www.w3.org" /> | |
|
| |
<title>PHP Weathermap |
<title>PHP Weathermap | |
v0.91 |
v0.97a | |
- Installation - Cacti Plugin and Editor</title> |
- Installation - Cacti Plugin and Editor</title> | |
<style type="text/css" media="print"> |
<style type="text/css" media="print"> | |
/*<![CDATA[*/ |
/*<![CDATA[*/ | |
body { font-size: 12pt; } |
body { font-size: 12pt; } | |
a { color: black; text-decoration: underline; font-weight: normal;} |
a { color: black; text-decoration: underline; font-weight: normal;} | |
Line 39... | Line 39... | |
</ul> |
</ul> | |
</div> |
</div> | |
|
| |
<div id="header"> |
<div id="header"> | |
<h1>PHP Weathermap |
<h1>PHP Weathermap | |
v0.91 |
v0.97a | |
</h1> |
</h1> | |
<h4>Copyright © 2005-2007 Howard Jones, <tt><a |
<h4>Copyright © 2005-2010 Howard Jones, <tt><a | |
href="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<a |
href="mailto:howie@thingy.com">howie@thingy.com</a></tt>. (<a | |
href="http://www.network-weathermap.com/">Website</a>)</h4> |
href="http://www.network-weathermap.com/">Website</a>)</h4> | |
</div> |
</div> | |
|
| |
|
| |
Line 57... | Line 57... | |
<p>You will need the 'pcre' and 'gd' PHP modules in <em>both your command-line and server-side (mod_php/ISAPI) PHP</em>. The poller-process runs using the command-line PHP, and the editor uses the server-side one. In some situations it is possible to have two completely different PHP installations serving these two - if you install from a package, then re-install from source, but to a different directory, for example. The editor and the poller process should both warn you if the part they need is not present.</p> |
<p>You will need the 'pcre' and 'gd' PHP modules in <em>both your command-line and server-side (mod_php/ISAPI) PHP</em>. The poller-process runs using the command-line PHP, and the editor uses the server-side one. In some situations it is possible to have two completely different PHP installations serving these two - if you install from a package, then re-install from source, but to a different directory, for example. The editor and the poller process should both warn you if the part they need is not present.</p> | |
|
| |
<p>You can then use the pre-install checker to see if your PHP environment has everything it needs. To do this, you need to run a special <tt>check.php</tt> script, twice...</p> |
<p>You can then use the pre-install checker to see if your PHP environment has everything it needs. To do this, you need to run a special <tt>check.php</tt> script, twice...</p> | |
<p>First, go to http://yourcactiserver/plugins/weathermap/check.php to see if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a command-prompt run <tt>php check.php</tt> to see if your command-line PHP is OK. If any modules or functions are missing, you will get a warning, and an explanation of what will be affected (not all of the things that are checked are deadly problems).</p> |
<p>First, go to http://yourcactiserver/plugins/weathermap/check.php to see if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a command-prompt run <tt>php check.php</tt> to see if your command-line PHP is OK. If any modules or functions are missing, you will get a warning, and an explanation of what will be affected (not all of the things that are checked are deadly problems).</p> | |
|
| |
<p>Before you start using it, you might want to change one PHP setting. Weathermap uses a fair bit of memory by PHP standards, as it builds the image for the map in memory before saving it. As a result, your PHP process <i>may</i> run out of memory. PHP has a 'safety valve' built-in, to stop runaway scripts from killing your server, which defaults to 8MB in most versions (this has changed in 5.2.x). This is controlled by the 'memory_limit =' line in php.ini. You may need to increase this to 32MB or even more if you have problems. These problems will typically show up as the poller process just dying with no warning or error message, as PHP kills the script.</p> |
<p>Before you start using it, you might want to change one PHP setting. Weathermap uses a fair bit of memory by PHP standards, as it builds the image for the map in memory before saving it. As a result, your PHP process <i>may</i> run out of memory. PHP has a 'safety valve' built-in, to stop runaway scripts from killing your server, which defaults to 8MB in most versions (this has changed in 5.2.x). This is controlled by the 'memory_limit =' line in php.ini. You may need to increase this to 32MB or even more if you have problems. In fact, the current Cacti manual suggests 128MB. These problems will typically show up as the poller process just dying with no warning or error message, as PHP kills the script.</p> | |
|
| |
<h4>Installation</h4> |
<h4>Installation</h4> | |
<p>To use the Cacti plugin, you <i>must</i> unpack the zip file into a directory called '<i><cacti_root></i>/plugins/weathermap'. The zip contains a folder called 'weathermap' already, so unzipping it in the plugins folder should do the job.</p> |
<p>To use the Cacti plugin, you <i>must</i> unpack the zip file into a directory called '<i><cacti_root></i>/plugins/weathermap'. The zip contains a folder called 'weathermap' already, so unzipping it in the plugins folder should do the job.</p> | |
|
| |
<h4>File Permissions</h4> |
<h4>File Permissions</h4> | |
Line 72... | Line 72... | |
chown cactiuser output |
chown cactiuser output | |
</pre></div> |
</pre></div> | |
|
| |
<h4>Getting Started</h4> |
<h4>Getting Started</h4> | |
|
| |
<p>To actually enable the plugin, you need to add a line to your Cacti includes/config.php file: |
<p>To actually enable the plugin, you need to add a line to your Cacti config file. This file is includes/config.php for Cacti 0.8.6 and includes/global.php for Cacti 0.8.7: | |
<div class="shell"><pre> |
<div class="shell"><pre> | |
$plugins = array(); |
$plugins = array(); | |
$plugins[] = 'monitor'; |
$plugins[] = 'monitor'; | |
<b>$plugins[] = 'weathermap';</b> |
<b>$plugins[] = 'weathermap';</b> | |
</pre></div> |
</pre></div> | |
Line 105... | Line 105... | |
</div> |
</div> | |
|
| |
In a pinch, you can just <tt>chmod 777 configs</tt>, but this <em>really isn't</em> a recommended solution for a production system.</p> |
In a pinch, you can just <tt>chmod 777 configs</tt>, but this <em>really isn't</em> a recommended solution for a production system.</p> | |
<p>On Windows, the same applies - the user that runs the webserver runs as should have permissions to write new files, and change existing files in the configs folder.</p> |
<p>On Windows, the same applies - the user that runs the webserver runs as should have permissions to write new files, and change existing files in the configs folder.</p> | |
</p> |
</p> | |
| ||
| ||
<p>Since version 0.97, you now also need to enable the editor. The reason is so that you can't have the editor enabled without | ||
knowing about it. The editor allows access to your config files without authentication (it doesn't use Cacti's authentication), so you should consider using | ||
features in your webserver to limit who can access <tt>editor.php</tt>. For example, on an Apache server, something like: | ||
<pre> | ||
<Directory /var/www/html/cacti/plugins/weathermap> | ||
<Files editor.php> | ||
Order Deny,Allow | ||
Deny from all | ||
Allow from 127.0.0.1 | ||
</Files> | ||
</Directory> | ||
</pre> | ||
When you are happy that the world can't edit your maps, then enable the editor. This is done by editing the top of editor.php and changing <code>$ENABLED=false;</code> to <code>$ENABLED=true;</code></p> | ||
| ||
<p> |
<p> | |
You should now be able to go to http://your.server/cacti/plugins/weathermap/editor.php in a browser, and get a welcome page that offers to load or create a config file. That's it. All done. Please see the <a href="editor.html">editor manual page</a> for more about <i>using</i> the editor! |
You should now be able to go to http://your.server/cacti/plugins/weathermap/editor.php in a browser, and get a welcome page that offers to load or create a config file. That's it. All done. Please see the <a href="editor.html">editor manual page</a> for more about <i>using</i> the editor! | |
</p> |
</p> | |
<p>You can also edit an existing map from the Cacti web interface, by choosing Manage..Weathermaps and then clicking on the name of a config file in the list of active maps. The editor will open with that map loaded.</p> | ||
<p> |
<p> | |
<strong>Important Security Note:</strong> The editor allows <i>anyone</i> who can access editor.php to change the configuration files for your network weathermaps. There is no authentication built-in for editing, even with the Cacti Plugin. This is why the configuration file doesn't exist by default - the editor won't work until you choose to make it work. It's recommended that you either: <ul><li>change the ownership of configuration files so that the editor can't write to them once they are complete, or </li><li>use your webserver's authentication and access control facilities to limit who can access the editor.php URL. On apache, this can be done using the FilesMatch directive and mod_access.</li></ul> |
<strong>Important Security Note:</strong> The editor allows <i>anyone</i> who can access editor.php to change the configuration files for your network weathermaps. There is no authentication built-in for editing, even with the Cacti Plugin. This is why the configuration file doesn't exist by default - the editor won't work until you choose to make it work. It's recommended that you either: <ul><li>change the ownership of configuration files so that the editor can't write to them once they are complete, or </li><li>use your webserver's authentication and access control facilities to limit who can access the editor.php URL. On apache, this can be done using the FilesMatch directive and mod_access.</li></ul> | |
</p> |
</p> | |
|
| |
</div> |
</div> |