';
249 | }
250 |
251 | - if (! $cacti_found && !$ignore_cacti) {
252 | - $errormessage .= '$cacti_base is not set correctly. Cacti integration will be disabled in the editor.';
253 | - if ($config_loaded != 1) {
254 | - $errormessage .= " You might need to copy editor-config.php-dist to editor-config.php and edit it.";
255 | - }
256 | + if ( !$observium_found && !$ignore_observium) {
257 | + //$errormessage .= '$cacti_base is not set correctly. Cacti integration will be disabled in the editor.';
258 | + //$errormessage .= "$observium_found and $ignore_observium";
259 | + //if ($config_loaded != 1) {
260 | + //$errormessage .= " You might need to copy editor-config.php-dist to editor-config.php and edit it.";
261 | + //}
262 | }
263 |
264 | if ($errormessage != '') {
265 | Only in weathermap.orig/: logout.php
266 | Only in weathermap/: map-poller.php
267 | Only in weathermap.orig/: net-data.txt
268 | Only in weathermap.orig/: output
269 | Only in weathermap.orig/: random-bits
270 | Only in weathermap.orig/: setup.php
271 | diff -ur weathermap.orig/weathermap weathermap/weathermap
272 | --- weathermap.orig/weathermap 2013-04-02 20:50:32.000000000 +0100
273 | +++ weathermap/weathermap 2013-12-06 02:15:56.000000000 +0000
274 | @@ -37,6 +37,7 @@
275 | "version",
276 | "help",
277 | "image-uri=",
278 | + "base-href=",
279 | "config=",
280 | "output=",
281 | "debug",
282 | @@ -85,6 +86,10 @@
283 | $options_output['imageuri'] = $o[1];
284 | break;
285 |
286 | + case '--base-href':
287 | + // $map->basehref=$o[1];
288 | + $options_output['basehref'] = $o[1];
289 | + break;
290 | case '--dumpconfig':
291 | //$map->dumpconfig=$o[1];
292 | // $options_output['dumpconfig'] = $o[1];
293 | @@ -163,6 +168,7 @@
294 | print " --output {filename} - filename to write image. Default weathermap.png\n";
295 | print " --htmloutput {filename} - filename to write HTML. Default weathermap.html\n\n";
296 |
297 | + print " --base-href {uri} - URI for Weathermap, i.e /weathermap/\n";
298 | print " --image-uri {uri} - URI to prefix tags in HTML.\n";
299 | print " --bulge - Enable link-bulging mode. See manual.\n\n";
300 |
301 | @@ -256,6 +262,7 @@
302 | $fd=fopen($htmlfile, 'w');
303 | fwrite($fd,
304 | '
');
305 | + fwrite($fd,"basehref\">");
306 | if($map->htmlstylesheet != '') fwrite($fd,'');
307 | fwrite($fd,'' . $map->ProcessString($map->title, $map) . '');
308 |
309 | Only in weathermap.orig/: weathermap-cacti-plugin-mgmt.php
310 | Only in weathermap.orig/: weathermap-cacti-plugin.css
311 | Only in weathermap.orig/: weathermap-cacti-plugin.php
312 | Only in weathermap.orig/: weathermap-cacti-rebuild.php
313 | Only in weathermap.orig/: weathermap.conf
314 |
--------------------------------------------------------------------------------
/check-gdbug.php:
--------------------------------------------------------------------------------
1 | ");
15 |
16 | print wordwrap("This program will test if your PHP installation is using a buggy GD library.");
17 | print ($env=='CLI'?"\n\n":"\n
");
18 |
19 | print wordwrap("If you are, you should either use PHP's built-in (aka 'bundled') GD library, or update to GD Version 2.0.34 or newer. Weathermap REQUIRES working Alpha support.");
20 | print ($env=='CLI'?"\n\n":"\n
");
21 |
22 | print wordwrap("Let's see if you have the GD transparency bug...");
23 | print ($env=='CLI'?"\n\n":"\n
");
24 | print wordwrap("If you see no more output, or a segfault, then you do, and you'll need to upgrade.");
25 | print ($env=='CLI'?"\n\n":"\n
");
26 | print wordwrap("If you get other errors, like 'undefined function', then run check.php to\nmake sure that your PHP installation is otherwise OK.");
27 | print ($env=='CLI'?"\n\n":"\n
");
30 |
31 | // make sure even the affected folks can see the explanation
32 | ob_flush();
33 | flush();
34 |
35 | $temp_width = 10;
36 | $temp_height = 10;
37 |
38 | $node_im=imagecreatetruecolor($temp_width,$temp_height );
39 | imageSaveAlpha($node_im, TRUE);
40 | $nothing=imagecolorallocatealpha($node_im,128,0,0,127);
41 | imagefill($node_im, 0, 0, $nothing);
42 | imagedestroy($node_im);
43 |
44 | print "...nope. We got past the risky part, so that's good.\nYour GD library looks healthy.\n";
45 | print ($env=='CLI'?"\n":"\n
");
46 | ?>
--------------------------------------------------------------------------------
/check.php:
--------------------------------------------------------------------------------
1 | 0) && ($mem_allowed_int < 32000000)) { $mem_warning='You should increase this value to at least 32M. '; }
10 |
11 | // capture the PHP "General Info" table
12 | ob_start();
13 | phpinfo(INFO_GENERAL);
14 | $s = ob_get_contents();
15 | ob_end_clean();
16 |
17 | //
System
Windows NT BLINKYZERO 6.0 build 6000
18 | // since preg_* are potentially missing, we'll have to do this without regexps.
19 | foreach (explode("\n",$s) as $line)
20 | {
21 | $line = str_replace('
','',$line);
22 | $line = str_replace('
','',$line);
23 | $line = str_replace('
',' => ',$line);
24 | $sep_pos = strpos($line," => ");
25 | if($sep_pos!==FALSE)
26 | {
27 | // by here, it should be a straight "name => value"
28 | $name = substr($line,0,$sep_pos);
29 | $value = substr($line,$sep_pos+4);
30 | $php_general[$name] = $value;
31 | }
32 | }
33 |
34 | $ini_file = $php_general['Loaded Configuration File'];
35 | $extra_ini = php_ini_scanned_files();
36 | if($extra_ini != '')
37 | { $extra_ini = "The following additional ini files were read: $extra_ini"; }
38 | else { $extra_ini = "There were no additional ini files, according to PHP."; }
39 |
40 | $gdversion = "";
41 | $gdbuiltin=FALSE;
42 | $gdstring = "";
43 | if(function_exists('gd_info'))
44 | {
45 | $gdinfo = gd_info();
46 | $gdversion=$gdinfo['GD Version'];
47 | if(strpos($gdversion,"bundled") !== FALSE)
48 | {
49 | $gdbuiltin=TRUE;
50 | $gdstring="This PHP uses the 'bundled' GD library, which doesn't have alpha-blending bugs. That's good!\n";
51 | }
52 | else
53 | {
54 | $gdstring="This PHP uses the system GD library, which MIGHT have alpha-blending bugs. Check that you have at least GD 2.0.34 installed, if you see problems with weathermap segfaulting.\n";
55 | $gdstring .= "You can test for this specific fault by running check-gdbug.php\n";
56 | }
57 | }
58 | else
59 | {
60 | $gdstring = "The gdinfo() function is not available, which means that either the GD extension is not available, not enabled, or not installed.\n";
61 | }
62 |
63 | if(isset($argv))
64 | {
65 | $environment = "CLI";
66 | print "\n----------------------------------------------------\nWeathermap Pre-Install Checker\n\n";
67 | print "This script checks for some common problems with your PHP and server\nenvironment that may stop Weathermap or the Editor from working.\n\n";
68 | print "NOTE: You should run this script as both a web page AND from the\ncommand-line, as the environment can be different in each.\n";
69 | print "\nThis is the PHP version that is responsible for \n* creating maps from the Cacti poller\n* the command-line weathermap tool\n\n";
70 | print "PHP Basics\n----------\n";
71 | print wordwrap("This is PHP Version $php_version running on \"$php_os\" with a memory_limit of '$mem_allowed'. $mem_warning\n");
72 | print "\nThe php.ini file was $ini_file\n$extra_ini\n\n";
73 | print "";
74 | print "PHP Functions\n-------------\n";
75 | print "Some parts of Weathermap need special support in your PHP\ninstallation to work.\n\n";
76 | print wordwrap($gdstring)."\n";
77 | }
78 | else
79 | {
80 | $environment = "web";
81 | ?>
82 |
83 |
84 |
85 | Weathermap Pre-Install Checker
86 |
94 |
95 |
96 |
97 |
Weathermap Pre-install Checker
98 |
99 |
This page checks for some common problems with your PHP and server environment that may stop Weathermap or the Editor from working.
100 |
NOTE: You should run this script as a web page AND from the command-line, as the environment can be different in each.
101 |
PHP Basics
This is the PHP version that is responsible for
102 |
The web-based editor
Building maps with Rebuild Now from Cacti
103 |
This is PHP Version running on "" with a memory_limit of ''.
104 |
The php.ini file was
105 |
106 |
PHP Functions
107 |
Some parts of Weathermap need special support in your PHP installation to work.
108 |
109 |
110 | array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'),
120 | 'imagecreatetruecolor' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'),
121 | 'imagealphablending' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'),
122 | 'imageSaveAlpha' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'),
123 | 'preg_match'=> array(TRUE,FALSE,'configuration reading','provided by the "pcre" extension') ,
124 | 'imagecreatefrompng' => array(TRUE,FALSE,'all of Weathermap','part of the GD library and the "gd" PHP extension'),
125 |
126 | 'imagecreatefromjpeg' => array(FALSE,FALSE,'JPEG input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'),
127 | 'imagecreatefromgif' => array(FALSE,FALSE,'GIF input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'),
128 | 'imagejpeg' => array(FALSE,FALSE,'JPEG output support','an optional part of the GD library and the "gd" PHP extension'),
129 | 'imagegif' => array(FALSE,FALSE,'GIF output support','an optional part of the GD library and the "gd" PHP extension'),
130 | # 'imagefilter' => array(FALSE, FALSE, 'colorizing icons','a special function of the PHP-supplied GD library ONLY (not the external GD library'.($gdbuiltin?'':' that you are using').')'),
131 | 'imagecopyresampled' => array(FALSE,FALSE,'Thumbnail creation in the Cacti plugin','an optional part of the GD library and the "gd" PHP extension'),
132 | 'imagettfbbox' => array(FALSE,FALSE,'TrueType font support','an optional part of the GD library and the "gd" PHP extension'),
133 | 'memory_get_usage' => array(FALSE,TRUE,'memory-usage debugging','not supported on all PHP versions and platforms')
134 | );
135 |
136 | $results=array();
137 |
138 | if($environment == 'CLI')
139 | {
140 | // Console_Getopt is only needed by the CLI tool.
141 | $included = @include_once 'Console/Getopt.php';
142 |
143 | if($included != 1)
144 | {
145 | $noncritical++;
146 | print wordwrap("The Console_Getopt PEAR module is not available. The CLI weathermap tool will not run without it (that may not be a problem, if you only intend to use Cacti).\n\n");
147 | }
148 | else
149 | {
150 | print wordwrap("The Console_Getopt PEAR module is available. That's good!\n\n");
151 | }
152 |
153 | }
154 |
155 | foreach ($functions as $function=>$details)
156 | {
157 | $exists = ""; $notes="";
158 | if($environment=='web') print "
check that the 'extension=' line for that extension is uncommented in your php.ini file (then restart your webserver), or
install the extension, if it isn't installed already
";
220 | }
221 | else
222 | {
223 | print "\nIf these functions are not found, you may need to\n * check that the 'extension=' line for that extension is uncommented in\n your php.ini file (then restart your webserver), or\n * install the extension, if it isn't installed already\n\n";
224 | }
225 |
226 | print wordwrap("The details of how this is done will depend on your operating system, and on where you installed (or compiled) your PHP from originally. Usually, you would install an RPM, or other package on Linux systems, a port on *BSD, or a DLL on Windows. If you build PHP from source, you need to add extra options to the './configure' line. Consult your PHP documention for more information.\n");
227 | if($environment=='web') print "";
228 | }
229 |
230 | if($environment=="CLI") print "\n---------------------------------------------------------------------\n";
231 |
232 | if($critical>0)
233 | {
234 | if($environment=='web') print "
";
235 | print wordwrap("There are problems with your PHP or server environment that will stop Weathermap from working. You need to correct these issues if you wish to use Weathermap.\n");
236 | if($environment=='web') print "
";
243 | print wordwrap("Some features of Weathermap will not be available to you, due to lack of support in your PHP installation. You can still proceed with Weathermap though.\n");
244 | if($environment=='web') print "
";
250 | print wordwrap("OK! Your PHP and server environment *seems* to have support for ALL of the Weathermap features. Make sure you have run this script BOTH as a web page and from the CLI to be sure, however.\n");
251 | if($environment=='web') print "
";
252 |
253 | }
254 | }
255 | if($environment=='web') print "";
256 |
257 | function return_bytes($val) {
258 | $val = trim($val);
259 | if($val != '')
260 | {
261 | $last = strtolower($val{strlen($val)-1});
262 | switch($last) {
263 | // The 'G' modifier is available since PHP 5.1.0
264 | case 'g':
265 | $val *= 1024;
266 | case 'm':
267 | $val *= 1024;
268 | case 'k':
269 | $val *= 1024;
270 | }
271 | }
272 | else
273 | {
274 | $val = 0;
275 | }
276 |
277 | return $val;
278 | }
279 | ?>
280 |
281 |
282 |
283 |
--------------------------------------------------------------------------------
/configs/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Order deny,allow
3 | Deny from all
4 |
5 |
--------------------------------------------------------------------------------
/configs/index.php:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/docs/example/Gradient_BK_800.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/Gradient_BK_800.png
--------------------------------------------------------------------------------
/docs/example/Vera.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/Vera.ttf
--------------------------------------------------------------------------------
/docs/example/VeraBI.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraBI.ttf
--------------------------------------------------------------------------------
/docs/example/VeraBd.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraBd.ttf
--------------------------------------------------------------------------------
/docs/example/VeraIt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraIt.ttf
--------------------------------------------------------------------------------
/docs/example/VeraMoBI.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraMoBI.ttf
--------------------------------------------------------------------------------
/docs/example/VeraMoBd.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraMoBd.ttf
--------------------------------------------------------------------------------
/docs/example/VeraMoIt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraMoIt.ttf
--------------------------------------------------------------------------------
/docs/example/VeraMono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraMono.ttf
--------------------------------------------------------------------------------
/docs/example/VeraSe.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraSe.ttf
--------------------------------------------------------------------------------
/docs/example/VeraSeBd.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/VeraSeBd.ttf
--------------------------------------------------------------------------------
/docs/example/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/background.png
--------------------------------------------------------------------------------
/docs/example/example.conf:
--------------------------------------------------------------------------------
1 | #
2 | # some initial comments...
3 | #
4 | # This sample configuration file demonstrates most of the basic features of
5 | # PHP Weathermap, along with some of the cosmetic and layout changes possible
6 | #
7 | # NOTE: to use this file as it stands, you need to keep it together with
8 | # the relevant font, background and icon image files.
9 |
10 |
11 | BACKGROUND background.png
12 | HTMLOUTPUTFILE example.html
13 | IMAGEOUTPUTFILE example.png
14 | TITLE Network Overview
15 | HTMLSTYLE overlib
16 | KEYPOS 10 400
17 |
18 | # define some new TrueType fonts - built-in ones go from 1 to 5, so start high
19 | FONTDEFINE 100 ./VeraIt.ttf 8
20 | FONTDEFINE 101 ./Vera.ttf 12
21 | FONTDEFINE 102 ./Vera.ttf 9
22 |
23 | KEYFONT 102
24 |
25 | LINK DEFAULT
26 | BANDWIDTH 100M
27 | BWLABEL bits
28 | BWFONT 100
29 | OVERLIBWIDTH 395
30 | OVERLIBHEIGHT 153
31 | WIDTH 4
32 |
33 | NODE DEFAULT
34 | LABELFONT 101
35 |
36 | NODE transit
37 | POSITION 400 180
38 | LABEL TRANSIT
39 |
40 | # a little splash of background colour for these nodes
41 | NODE isp1
42 | POSITION 250 100
43 | LABEL ISP1
44 | INFOURL http://www.isp1.com/support/lookingglass.html
45 | LABELBGCOLOR 255 224 224
46 |
47 | NODE isp2
48 | POSITION 550 100
49 | LABEL ISP2
50 | INFOURL http://www.isp2.net/portal/
51 | LABELBGCOLOR 224 255 224
52 |
53 | NODE core
54 | POSITION 400 300
55 | LABEL core
56 | INFOURL https://core.mynet.net/admin/
57 |
58 | NODE customer1
59 | LABEL xy.com
60 | POSITION 150 370
61 |
62 | NODE customer2
63 | LABEL ww.co.uk
64 | POSITION 250 450
65 |
66 | NODE infra
67 | LABEL INFRASTRUCTURE
68 | POSITION 450 450
69 |
70 | # this node has an icon, and so we push the label to the South edge of it, so it
71 | # can still be read
72 | NODE sync
73 | LABEL Sync
74 | ICON my_router.png
75 | LABELOFFSET S
76 | LABELFONT 2
77 | POSITION 550 370
78 | # the icon is taken from a Nagios icon pack:
79 | # http://www.nagiosexchange.org/Image_Packs.75.0.html?&tx_netnagext_pi1[p_view]=110&tx_netnagext_pi1[page]=10%3A10
80 |
81 | NODE site1
82 | LABEL site1
83 | POSITION 700 220
84 |
85 | NODE site2
86 | LABEL site2
87 | POSITION 750 420
88 |
89 | LINK sync-core
90 | NODES sync core
91 | TARGET data/sync_traffic_in_259.rrd
92 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=256&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
93 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=256
94 | #
95 | # Site1 has two E1s, so we use NODE-offsets to allow them to run parallel
96 | #
97 |
98 | LINK sync-site1a
99 | NODES sync:N site1:W
100 | WIDTH 3
101 | TARGET data/sync_traffic_in_257.rrd
102 | BANDWIDTH 2M
103 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=254&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=
104 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=126
105 |
106 | LINK sync-site1b
107 | NODES sync:E site1:SE
108 | WIDTH 3
109 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=255&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=
110 | TARGET data/sync_traffic_in_258.rrd
111 | BANDWIDTH 2M
112 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=56
113 |
114 | #
115 | # site2 also has two links, but this time we use the VIA to curve the links
116 | #
117 | LINK sync-site2a
118 | NODES sync site2
119 | WIDTH 3
120 | VIA 650 380
121 | TARGET data/sync_traffic_in_251.rrd
122 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=248&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
123 | BANDWIDTH 1M
124 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=252
125 |
126 | LINK sync-site2b
127 | NODES sync site2
128 | WIDTH 3
129 | VIA 650 420
130 | TARGET data/sync_traffic_in_252.rrd
131 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=228&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
132 | BANDWIDTH 1M
133 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=561
134 |
135 | #
136 | # ISP 1 has a several links, again, but they prefer to see one arrow, and the aggregate bandwidth
137 | # so we use multiple TARGETs on one line, here, to sum the data
138 |
139 | LINK transit-isp1
140 | NODES transit isp1
141 | TARGET data/trans1_traffic_in_352.rrd data/trans1_traffic_in_378.rrd data/trans1_traffic_in_420.rrd
142 | BANDWIDTH 10M
143 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=355&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=
144 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=633
145 |
146 | LINK transit-isp2
147 | NODES transit isp2
148 | TARGET data/trans1_traffic_in_438.rrd
149 | BANDWIDTH 34M
150 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=433&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
151 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=265
152 |
153 | LINK core-transit
154 | NODES transit core
155 | TARGET data/trans1_traffic_in_350.rrd
156 | ARROWSTYLE compact
157 | WIDTH 4
158 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=347&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
159 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=122
160 |
161 | LINK cust1-core
162 | NODES customer1 core
163 | TARGET data/extreme_traffic_in_299.rrd
164 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=296&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
165 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=237
166 |
167 | LINK cust2-core
168 | NODES customer2 core
169 | TARGET data/extreme_traffic_in_286.rrd
170 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=283&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
171 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=222
172 |
173 | LINK infra-core
174 | NODES infra core
175 | TARGET data/extreme_traffic_in_294.rrd
176 | OVERLIBGRAPH http://support.mynet.net/cacti/graph_image.php?local_graph_id=291&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
177 | INFOURL http://support.mynet.net/cacti/graph.php?rra_id=all&local_graph_id=228
178 |
--------------------------------------------------------------------------------
/docs/example/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/example.png
--------------------------------------------------------------------------------
/docs/example/graph_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tobzsc/weathermap-for-observium/b65eb7d48126680b4a5575d63f96f61721746ceb/docs/example/graph_image.png
--------------------------------------------------------------------------------
/docs/example/graph_page.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 | Your router history
7 |
8 |
9 |
10 |
11 |
Your history here
12 |
13 |
14 |
15 |
16 |
And this would normally be a page within your Cacti or MRTG system.
There are also a growing number of articles at
50 | network-weathermap.com
51 | about specific tricks and techniques for making your own maps, including
52 | animation, non-network maps and more!
53 |
54 |
What I'm trying to say is
55 | RTFM,
56 | but in a more polite way!
57 | :-) I put a fair amount of my own time and effort into writing the
58 | program, and then a whole bunch
59 | more into writing the manual and other documentation - more than a thousand hours by now. I also spend my
60 | spare time supporting Weathermap users [I'm one of the all-time most active users on the Cacti forums], but a lot of questions asked are
61 | answered in the manual, or worse still, in the FAQ section.
62 | Please take a look.
63 |
64 |
Visual Guides
65 |
66 |
If you are more visually-minded, like me, then the following might also help:
Diagram explaining a lot of the basic map
75 | formatting commands. Look in the
76 | Configuration Reference
77 | for more information on the commands mentioned.
78 |
79 | Larger version |
80 | PDF version
As you can see,
48 | all the parameters are optional! By default the script will look
49 | for a configuration file called
50 | weathermap.conf, and produce a PNG image file called
51 | weathermap.png.
52 |
53 |
Options
54 |
--output is used to specify the name of the PNG file that is
55 | created. This can also now be specified inside the configuration file,
56 | instead.
57 |
58 |
--config is used to specify the name of the configuration
59 | file that is read.
60 |
61 |
--debug enables a lot of chatty debug output that may be
62 | useful in the event of a problem. In case
63 | --debug isn't verbose enough for you,
64 | --dumpafter dumps the whole of the internal structure used by
65 | weathermap at the end of a run. Note that particularly with PHP 4.x,
66 | it's possible that this will never end, as the way that references to
67 | objects are handled has changed between PHP 4 and PHP 5.
68 |
69 |
--dumpconfig writes out a new configuration file after
70 | reading in the specified one. This is useful when migrating older
71 | configuration files, as it will remove extra stuff made redundant by the
72 | newer 'default link and node' style of
73 | configuration. Obviously, you should be careful not to overwrite your
74 | existing configuration files!
75 |
76 |
--sizedebug simply tells weathermap to draw the links with
77 | themaximum bandwidth shown, not the current. It only works if
78 | BWLABEL is set to 'bits', but it is useful for checking you have the
79 | right sized links once you have finished your map.
80 |
81 |
--define allows you to define additional internal variables
82 | for this run. It is equivalent to a
83 | SET line in the global
84 | section of the map configuration file.
85 |
86 |
--htmloutput specifies the name for an HTML file to be
87 | generated to go with the PNG image file. This HTML can include imagemap
88 | and DHTML features to make your weathermap interactive to different
89 | degrees. This is governed by the
90 | HTMLSTYLE
91 | global setting, and INFOURL and
92 | OVERLIBGRAPH settings in NODE and LINK definitions. This can
93 | also now be specified inside the configuration file, instead.
94 |
95 |
--image-uri specifies the URI used in an HTML file
96 | generated. If you are generating HTML in a different directory from the
97 | one the image is created, then weathermap will probably get the <img
98 | src=""> tag wrong. This option allows you to override the contents of
99 | the src attribute, if you know better.
Note: This section is basically unaltered from
40 | the v0.7 manual. The editor hasn't really changed since then, except to fix
41 | some bugs, and work with the new config directives
42 | - that is to say, it won't edit them, but nor will it remove/damage them.
43 | It's still true to say that the editor is the easiest way to initially lay
44 | out your map, and pick your TARGETs if you use Cacti, but after that, some
45 | hand-editing will help with cosmetics.
46 |
47 |
48 |
New in version 0.7, there is a partially-complete interactive editor
49 | included. In this release, it allows for visual layout of nodes and links,
50 | modification of most parameters, and some integration with Cacti for picking
51 | data-sources.
52 | It is not integrated into Cacti's management pages, OR access
53 | control.
54 |
55 |
To use the editor, you need to make a few extra considerations beyond
56 | those needed by the command-line weathermap software, as detailed in the
57 | Installation Guide.
58 |
59 |
60 |
61 | Once you have all that taken care of, put a copy of one of your
62 | configuration files into the configs directory you just created, and then go
63 | to: http://www.your.web.server/cacti/php-weathermap/editor.php (or
64 | whereever you put it). You should get a menu to either create a map, or open
65 | the ones you just put in that directory.
66 |
67 |
68 |
69 | Hopefully, the actual editor is fairly self-explanatory.
70 |
71 |
72 |
You can click on any existing node or link to get it's properties
73 | and change them.
You can delete a node or link from the
74 | properties box. For nodes, you can move them from the properties box
75 | too.
You can move the key or timestamp by clicking on them,
76 | also.
If you set up the Cacti-related options in the
77 | editor-config.php file, then you should also see an additional option to
78 | pick a data source directly from Cacti, in the Link Properties
79 | box.
To create a new node, choose the 'Add Node' button at the
80 | top and then click on the map where you want the node to be.
To
81 | create a new link, choose the 'Add Link' button then click on the two
82 | nodes to link together, in turn. There are separate buttons at the top
83 | for changing various global parameters.
84 |
85 |
There is no save
86 | - Every change is written back to the configuration file immediately.
87 | Make a backup copy if you feel the need to.
88 |
89 |
90 |
91 |
92 | There are a number of things not editable in the editor currently:
93 |
94 |
95 |
background images and icons
96 | - it's intended that the editor will allow you to upload image files to
97 | the server, which will then appear in a list where appropriate.
98 |
99 |
colours
100 | - there's no way to pick colours currently, either for the map elements
101 | or for the scale.
102 |
103 |
defaults
104 | - the editor lags behind the current command-line software here. It
105 | generates 'old-style' global options for some features where the correct
106 | thing to do is make changes to the DEFAULT link and node definitions.
107 | Similarly, there is no per-node or per-link adjustment of things like
108 | font, label style or label offset.
118 |
119 | Luckily, the editor shouldn't damage any of these things that you put into
120 | the configuration file by hand, so it's safe to do some work in the editor
121 | where it's quicker or more intuitive, and then fine-tune the file by hand.
122 |
123 |
124 |
Before doing anything else, please verify that your
45 | Plugin Architecture is working
46 | properly with a simpler plugin, like
47 | Links or
48 | Tools. Weathermap is relatively
49 | complex, and fault-finding both your Cacti Plugin Architecture and
50 | Weathermap at the same time will make life harder for you!
51 |
52 |
You will need the 'pcre' and 'gd' PHP modules in
53 | both your command-line and server-side (mod_php/ISAPI) PHP. The
54 | poller-process runs using the command-line PHP, and the editor uses the
55 | server-side one. In some situations it is possible to have two completely
56 | different PHP installations serving these two
57 | - if you install from a package, then re-install from source, but to a
58 | different directory, for example. The editor and the poller process should
59 | both warn you if the part they need is not present.
60 |
61 |
You can then use the pre-install checker to see if your PHP environment
62 | has everything it needs. To do this, you need to run a special
63 | check.php script, twice...
64 |
65 |
First, go to http://yourcactiserver/plugins/weathermap/check.php to see
66 | if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a
67 | command-prompt run
68 | php check.php to see if your command-line PHP is OK. If any modules
69 | or functions are missing, you will get a warning, and an explanation of what
70 | will be affected (not all of the things that are checked are deadly
71 | problems).
72 |
73 |
Before you start using it, you might want to change one PHP setting.
74 | Weathermap uses a fair bit of memory by PHP standards, as it builds the
75 | image for the map in memory before saving it. As a result, your PHP process
76 | may run out of memory. PHP has a 'safety valve' built-in, to stop
77 | runaway scripts from killing your server, which defaults to 8MB in most
78 | versions (this has changed in 5.2.x). This is controlled by the
79 | 'memory_limit =' line in php.ini. You may need to increase this to 32MB or
80 | even more if you have problems. In fact, the current Cacti manual suggests
81 | 128MB. These problems will typically show up as the poller process just
82 | dying with no warning or error message, as PHP kills the script.
83 |
84 |
Installation
85 |
86 |
To use the Cacti plugin, you
87 | must unpack the zip file into a directory called
88 | '<cacti_root>/plugins/weathermap'. The zip contains a folder
89 | called 'weathermap' already, so unzipping it in the plugins folder should do
90 | the job.
91 |
92 |
File Permissions
93 |
94 |
95 | You will need to change the permissions on the
96 | output directory, so that the Cacti poller process can write to it.
97 | This is the same as you would have done for the
98 | rra directory while installing Cacti itself originally. For a *nix
99 | system, it will be something like:
100 |
101 |
102 |
103 | chown cactiuser output
104 |
105 |
106 |
107 |
Getting Started
108 |
109 |
To actually enable the plugin, you need to add a line to your Cacti
110 | config file. This file is includes/config.php for Cacti 0.8.6 and
111 | includes/global.php for Cacti 0.8.7(a through f), then includes/config.php again for 0.8.7g and newer:
112 |
113 |
114 |
123 | Now, refresh your Cacti page, to be sure that everything is still working
124 | right. If not, remove the line you just added and you should return to
125 | normal. Make a note of any error message and let me know!
126 |
127 |
128 |
129 | Assuming it all looks fine (but not
130 | very different), you can start to enable Weathermap. Log in as 'admin' or
131 | another user with User Management rights, go to the User Management section
132 | under Tools in the Cacti console, and then choose your own username from the
133 | list. Check the two new 'realms' boxes that should be there
134 | - View Weathermaps, and Manage Weathermaps
135 | - and then click Save. A 'Weathermap' tab should appear at the top of the
136 | page.
137 |
138 |
That's it! The Weathermap plugin is installed. To go further, you need
139 | some weathermap configuration files to define your maps. You can do this in
140 | two ways
141 | - using the Web-based map editor, or by editing the text-based configuration
142 | files directly.
143 |
144 |
To use the editor, you need to make a few more changes (see below).
145 |
146 |
To learn more about actually using the Cacti plugin, see the
147 | Cacti Plugin page.
148 |
149 |
The Editor
150 |
151 |
Once you have weathermap itself working, continue onto the editor:
152 |
153 |
154 | Copy the editor-config.php-dist file to
155 | editor-config.php. If you want to be able to pick data sources from
156 | your Cacti installation by name, edit the file and make sure that the line
157 | that sets
158 | $cacti_base is correct, and that the base URI below that is also
159 | correct for your Cacti installation (these two lines are marked CHANGE in
160 | the file).
161 |
162 |
163 |
164 | Make sure that your webserver can write to the configs directory. To do
165 | this, you need to know which user your webserver runs as (maybe 'nobody',
166 | 'www' or 'httpd' on most *nixes) and then run:
167 |
168 |
169 |
chown www configs
170 | chmod u+w configs
171 |
172 |
173 | In a pinch, you can just chmod 777 configs, but this
174 | really isn't a recommended solution for a production system.
175 |
176 |
On Windows, the same applies
177 | - the user that runs the webserver runs as should have permissions to write
178 | new files, and change existing files in the configs folder.
179 |
180 |
181 |
Since version 0.97, you now also need to enable the editor. The reason is
182 | so that you can't have the editor enabled without knowing about it. The
183 | editor allows access to your config files without authentication (it doesn't
184 | use Cacti's authentication), so you should consider using features in your
185 | webserver to limit who can access
186 | editor.php. For example, on an Apache server, something like:
187 |
188 |
189 | <Directory /var/www/html/cacti/plugins/weathermap>
190 | <Files editor.php>
191 | Order Deny,Allow
192 | Deny from all
193 | Allow from 127.0.0.1
194 | </FilesMatch>
195 | </Directory>
196 |
197 | When you are happy that the world can't edit your maps, then enable the
198 | editor. This is done by editing the top of editor.php and changing
199 | $ENABLED=false; to $ENABLED=true;
200 |
201 |
202 | You should now be able to go to
203 | http://your.server/cacti/plugins/weathermap/editor.php in a browser, and get
204 | a welcome page that offers to load or create a config file. That's it. All
205 | done. Please see the
206 | editor manual page for more about
207 | using the editor!
208 |
209 |
210 |
You can also edit an existing map from the Cacti web interface, by
211 | choosing Manage..Weathermaps and then clicking on the name of a config file
212 | in the list of active maps. The editor will open with that map loaded.
213 |
214 |
215 | Important Security Note: The editor allows
216 | anyone who can access editor.php to change the configuration files
217 | for your network weathermaps. There is no authentication built-in for
218 | editing, even with the Cacti Plugin. This is why the configuration file
219 | doesn't exist by default
220 | - the editor won't work until you choose to make it work. It's recommended
221 | that you either:
222 |
223 |
change the ownership of configuration files so that the editor can't
224 | write to them once they are complete, or
use your webserver's
225 | authentication and access control facilities to limit who can access the
226 | editor.php URL. On apache, this can be done using the FilesMatch directive
227 | and mod_access.
Before doing anything else, please verify that your
45 | Plugin Architecture is working
46 | properly with a simpler plugin, like
47 | Links or
48 | Tools. Weathermap is relatively
49 | complex, and fault-finding both your Cacti Plugin Architecture and
50 | Weathermap at the same time will make life harder for you!
51 |
52 |
You will need the 'pcre' and 'gd' PHP modules in
53 | your command-line PHP. The poller-process runs using the
54 | command-line PHP which is not always the same as the server-side one. In
55 | some situations it is possible to have two completely different PHP
56 | installations serving these two
57 | - if you install from a package, then re-install from source, but to a
58 | different directory, for example. The poller process should warn you if the
59 | part it needs is not present.
60 |
61 |
Before you start using it, you might want to change one PHP setting.
62 | Weathermap uses a fair bit of memory by PHP standards, as it builds the
63 | image for the map in memory before saving it. As a result, your PHP process
64 | may run out of memory. PHP has a 'safety valve' built-in, to stop
65 | runaway scripts from killing your server, which defaults to 8MB in most
66 | versions (this has changed in 5.2.x). This is controlled by the
67 | 'memory_limit =' line in php.ini. You may need to increase this to 32MB or
68 | even more if you have problems. In fact, the current Cacti manual suggests
69 | 128MB. These problems will typically show up as the poller process just
70 | dying with no warning or error message, as PHP kills the script.
71 |
72 |
Installation
73 |
74 |
To use the Cacti plugin, you
75 | must unpack the zip file into a directory called
76 | '<cacti_root>/plugins/weathermap'. The zip contains a folder
77 | called 'weathermap' already, so unzipping it in the plugins folder should do
78 | the job.
79 |
80 |
You can then use the pre-install checker to see if your PHP environment
81 | has everything it needs. To do this, you need to run a special
82 | check.php script, twice...
83 |
84 |
First, go to http://yourcactiserver/plugins/weathermap/check.php to see
85 | if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a
86 | command-prompt run
87 | php check.php to see if your command-line PHP is OK. If any modules
88 | or functions are missing, you will get a warning, and an explanation of what
89 | will be affected (not all of the things that are checked are deadly
90 | problems).
91 |
92 |
File Permissions
93 |
94 |
95 | You will need to change the permissions on the
96 | output directory, so that the Cacti poller process can write to it.
97 | This is the same as you would have done for the
98 | rra directory while installing Cacti itself originally. For a *nix
99 | system, it will be something like:
100 |
101 |
102 |
103 | chown cactiuser output
104 |
105 |
106 |
107 |
Getting Started
108 |
109 |
To actually enable the plugin, you need to add a line to your Cacti
110 | config file. This file is includes/config.php for Cacti 0.8.6 and
111 | includes/global.php for Cacti 0.8.7(a through f), then includes/config.php again for 0.8.7g and newer:
112 |
113 |
122 | Now, refresh your Cacti page, to be sure that everything is still working
123 | right. If not, remove the line you just added and you should return to
124 | normal. Make a note of any error message and let me know!
125 |
126 |
127 |
128 | Assuming it all looks fine (but not
129 | very different), you can start to enable Weathermap. Log in as 'admin' or
130 | another user with User Management rights, go to the User Management section
131 | under Tools in the Cacti console, and then choose your own username from the
132 | list. Check the two new 'realms' boxes that should be there
133 | - View Weathermaps, and Manage Weathermaps
134 | - and then click Save. A 'Weathermap' tab should appear at the top of the
135 | page.
136 |
137 |
That's it! The Weathermap plugin is installed. To go further, you need
138 | some weathermap configuration files to define your maps. You can do this in
139 | two ways
140 | - using the Web-based map editor, or by editing the text-based configuration
141 | files directly.
142 |
143 |
To use the editor, you need to make a few more changes.
144 |
145 |
To learn more about actually using the Cacti plugin, see the
146 | Cacti Plugin page.
You will need the 'pcre' and 'gd' PHP modules in
44 | both your command-line and server-side (mod_php/ISAPI) PHP. The
45 | command-line tool runs using the command-line PHP, and the editor uses the
46 | server-side one. In some situations it is possible to have two completely
47 | different PHP installations serving these two
48 | - if you install from a package, then re-install from source, but to a
49 | different directory, for example. The editor and the CLI tool should both
50 | warn you if the part they need is not present.
>
51 |
52 |
The command-line tool uses the Console_Getopt
53 | PEAR module. This comes as standard
54 | with PEAR, so you should be able to just install PEAR to get it. This may be
55 | a seperate package/port/RPM on your system, or you may need to install it
56 | from pear.php.net
57 |
58 |
Before you start using it, you might want to change one PHP setting.
59 | Weathermap uses a fair bit of memory by PHP standards, as it builds the
60 | image for the map in memory before saving it. As a result, your PHP process
61 | may run out of memory. PHP has a 'safety valve' built-in, to stop
62 | runaway scripts from killing your server, which defaults to 8MB in most
63 | versions (this has changed in 5.2.x). This is controlled by the
64 | 'memory_limit =' line in php.ini. You may need to increase this to 32MB or
65 | even more if you have problems. These problems will typically show up as the
66 | process just dying with no warning or error message, as PHP kills the
67 | script.
68 |
69 |
Installation
70 |
71 |
Unpack the zip file into a directory somewhere. If you are intending to
72 | use the browser-based editor, then the directory that you unpack the zip
73 | file into should be within the 'web space' on the web server that runs your
74 | data-collection application (that is, Cacti, MRTG, or similar)
75 | - /var/www/html, /usr/local/www/data or whatever it is for you.
76 |
77 |
You can then use the pre-install checker to see if your PHP environment
78 | has everything it needs. To do this, you need to run a special
79 | check.php script, twice...
80 |
81 |
First, go to http://yourcactiserver/plugins/weathermap/check.php to see
82 | if your webserver PHP (mod_php, ISAPI etc) is OK. Then, from a
83 | command-prompt run
84 | php check.php to see if your command-line PHP is OK. If any modules
85 | or functions are missing, you will get a warning, and an explanation of what
86 | will be affected (not all of the things that are checked are deadly
87 | problems).
88 |
89 |
90 | You'll need to edit two lines in the weathermap file:
91 |
92 |
93 |
If you are on a Unix-based platform (BSD, OS X, Linux etc), the path
94 | in the very top line should be the full path to your command-line php
95 | executable (usr/bin/php, or /usr/local/bin/php usually).
96 |
97 |
Around line 30 or so, you may need to change the path to your
98 | rrdtool executable, if you are intending to use RRD-based datasources
99 | for your maps.
100 |
101 |
102 |
103 |
Testing
104 |
105 | That should be it! You should be able to run
106 |
107 |
108 |
109 |
110 | ./weathermap
111 |
112 |
113 |
114 | or
115 |
116 |
117 |
118 | php weathermap (on Windows you will need this one)
119 |
from a shell or command prompt, and get a (rather boring)
120 | weathermap.png file in return. If you don't, you
121 | should get some kind of error to help you figure out why.
122 |
123 |
Editor
124 |
125 |
Once you have weathermap itself working, continue onto the editor:
126 |
127 |
128 | Copy the editor-config.php-dist file to
129 | editor-config.php. If you use Cacti, and want to be able to pick
130 | data sources from your Cacti installation by name, edit the file and make
131 | sure that the line that sets
132 | $cacti_base is correct, and that the base URI below that is also
133 | correct for your Cacti installation (these two lines are marked CHANGE in
134 | the file).
135 |
136 |
137 |
138 | Make sure that your webserver can write to the configs directory. To do
139 | this, you need to know which user your webserver runs as (maybe 'nobody',
140 | 'www' or 'httpd' on most *nixes) and then run:
141 |
142 |
143 |
chown www configs
144 | chmod u+w configs
145 |
146 |
147 | In a pinch, you can just chmod 777 configs, but this
148 | really isn't a recommended solution for a production system.
149 |
150 |
On Windows, the same applies
151 | - the user that runs the webserver runs as should have permissions to write
152 | new files, and change existing files in the configs folder.
153 |
154 |
155 |
156 |
Since version 0.97, you now also need to enable the editor. The reason is
157 | so that you can't have the editor enabled without knowing about it. The
158 | editor allows access to your config files without authentication, so you
159 | should consider using features in your webserver to limit who can access
160 | editor.php. For example, on an Apache server, something like:
161 |
162 |
163 | <Directory /var/www/html/weathermap>
164 | <Files editor.php>
165 | Order Deny,Allow
166 | Deny from all
167 | Allow from 127.0.0.1
168 | </FilesMatch>
169 | </Directory>
170 |
171 | When you are happy that the world can't edit your maps, then enable the
172 | editor. This is done by editing the top of editor.php and changing
173 | $ENABLED=false; to $ENABLED=true;
174 |
175 |
176 | You should now be able to go to
177 | http://yourserver/wherever-you-unpacked-weathermap/editor.php in a browser,
178 | and get a welcome page that offers to load or create a config file. That's
179 | it. All done. Please see the
180 | editor manual page for more about
181 | using the editor!
182 |
183 |
184 |
185 | Important Security Note: The editor allows
186 | anyone who can access editor.php to change the configuration files
187 | for your network weathermaps. There is no authentication built-in for
188 | editing, even with the Cacti Plugin. This is why the configuration file
189 | doesn't exist by default
190 | - the editor won't work until you choose to make it work. It's recommended
191 | that you either:
192 |
193 |
change the ownership of configuration files so that the editor can't
194 | write to them once they are complete, or
use your webserver's
195 | authentication and access control facilities to limit who can access the
196 | editor.php URL. On apache, this can be done using the FilesMatch directive
197 | and mod_access.
You will need the 'pcre' and 'gd' PHP modules in
44 | your command-line PHP. The command-line tool runs using the
45 | command-line PHP which is not always the same as the server-side one. In
46 | some situations it is possible to have two completely different PHP
47 | installations serving these two
48 | - if you install from a package, then re-install from source, but to a
49 | different directory, for example. The CLI tool should warn you if the part
50 | it needs is not present.
51 |
52 |
The command-line tool uses the Console_Getopt
53 | PEAR module. This comes as standard
54 | with PEAR, so you should be able to just install PEAR to get it. This may be
55 | a seperate package/port/RPM on your system, or you may need to install it
56 | from pear.php.net
57 |
58 |
Before you start using it, you might want to change one PHP setting.
59 | Weathermap uses a fair bit of memory by PHP standards, as it builds the
60 | image for the map in memory before saving it. As a result, your PHP process
61 | may run out of memory. PHP has a 'safety valve' built-in, to stop
62 | runaway scripts from killing your server, which defaults to 8MB in most
63 | versions (this has changed in 5.2.x). This is controlled by the
64 | 'memory_limit =' line in php.ini. You may need to increase this to 32MB or
65 | even more if you have problems. These problems will typically show up as the
66 | process just dying with no warning or error message, as PHP kills the
67 | script.
68 |
69 |
You can then use the pre-install checker to see if your PHP environment
70 | has everything it needs. To do this, you need to run a special
71 | check.php script. From a command-prompt run
72 | php check.php to see if your command-line PHP is OK. If any modules
73 | or functions are missing, you will get a warning, and an explanation of what
74 | will be affected (not all of the things that are checked are deadly
75 | problems).
76 |
77 |
Installation
78 |
79 |
Unpack the zip file into a directory somewhere. If you intend to just use
80 | the 'traditional' hand-written text configuration files, then it can be
81 | anywhere on the same server that runs your data-collection software (MRTG,
82 | Cricket, Cacti).
83 |
84 |
85 | You'll need to edit two lines in the weathermap file:
86 |
87 |
88 |
If you are on a Unix-based platform (BSD, OS X, Linux etc), the path
89 | in the very top line should be the full path to your command-line php
90 | executable (usr/bin/php, or /usr/local/bin/php usually).
91 |
92 |
Around line 30 or so, you may need to change the path to your
93 | rrdtool executable, if you are intending to use RRD-based datasources
94 | for your maps.
95 |
That should be it! You should be able to run
96 |
97 |
98 |
99 | ./weathermap
100 |
101 |
102 |
103 | or
104 |
105 |
106 |
107 | php weathermap (on Windows you will need this one)
108 |
from a shell or command prompt, and get a (rather boring)
109 | weathermap.png file in return. If you don't, you
110 | should get some kind of error to help you figure out why.
Make a backup of your working weathermap directory before you do
41 | this! Just in case you do need to roll back.
42 |
43 |
You should be able to upgrade from any previous version by simply
44 | unpacking the new one over the top. The files that will need to be changed
45 | afterwards are the same ones you edited when you first installed:
46 |
47 |
48 |
If you use the editor, then copy your editor-config.php out of the
49 | way, copy the new editor-config.php-dist over the top of the in-place
50 | editor-config.php and then make the same changes you made in your
51 | original install (cacti path and URI).
52 | This is especially important when upgrading to 0.92
53 |
54 |
If you use the command-line tool, you will need to put the path to
55 | rrdtool back in, around line 30 of the 'weathermap' file.
56 |
57 |
58 |
Any necessary database updates for Cacti users should be taken care of
59 | automatically.