Skip to content

Commit 6336fbd

Browse files
committed
Initial Weathermap plugin release
1 parent bbfd9b0 commit 6336fbd

File tree

180 files changed

+29053
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+29053
-0
lines changed

CHANGES

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

COPYING

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

INSTALL

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Extract to your observium / librenms install directory html/ so you should see something like /opt/observium/html/weathermap/
2+
The best way to do this is via git. Go to your install directory and then html/.
3+
Enter:
4+
git clone https://github.com/laf/Weathermap-for-Observium.git weathermap
5+
2. Edit map-poller.php and data-pick.php and make sure the variables at the start are all ok.
6+
**** Please ensure you set $pathd in map-poller.php correctly *****
7+
3. Within editor.php, make sure you set $ENABLED=true and check the correct url for $weathermap_url;
8+
4. Make the configs directory writeable by your web server, either chown apache:apache configs/ or chmod 777 configs (I'd highly advise you choose the first option, replace apache:apache with your web servers user and group.)
9+
5. Point your browser to your install /weathermap/editor.php (i.e http://testurl.org/weathermap/editor.php)
10+
6. Create your maps, please note when you create a MAP, please click Map Style, ensure Overlib is selected for HTML Style and click submit.
11+
7. Make the map-poller.php executable by running chmod +x map-poller.php
12+
8. Enable the cron process:
13+
Observium:
14+
*/5 * * * * /opt/observium/html/weathermap/map-poller.php >> /dev/null 2>&1
15+
16+
LibreNMS:
17+
*/5 * * * * /opt/librenms/html/weathermap/map-poller.php >> /dev/null 2>&1
18+
19+
**** IMPORTANT SECURITY *****
20+
21+
It is highly recommended that you set $ENABLED=false in editor.php when you are not editing maps as this is accessible by anyone unless you secure it via .htaccess or your web server config.

README

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
This is modified version of PHP Network Weathermap (orginal README is below)
2+
3+
The modified version starts at version 0.1 by Neil Lathwood ([email protected]) and currently includes basic support for picking out nodes and links from your observium install. See INSTALL for details.
4+
5+
This is PHP Network Weathermap, version 0.97b by Howard Jones ([email protected])
6+
7+
See the docs sub-directory for full HTML documentation, FAQ and example config.
8+
9+
See CHANGES for the most recent updates, listed by version.
10+
11+
See COPYING for the license under which php-weathermap is released.
12+
13+
There is much more information, tutorials and updates available at:
14+
http://www.network-weathermap.com/
15+
16+
17+
----
18+
19+
PHP Weathermap contains components from other software developers:
20+
21+
overlib.js is part of Overlib 4.21, copyright Erik Bosrup 1998-2004. All rights reserved.
22+
See http://www.bosrup.com/web/overlib/?License
23+
24+
The Bitstream Vera Open Source fonts (Vera*.ttf) are copyright Bitstream, Inc.
25+
See http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html
26+
27+
The manual uses the Kube CSS Framework - http://imperavi.com/kube/
28+
and ParaType's PT Sans font: http://www.fontsquirrel.com/fonts/PT-Sans
29+
30+
jquery-latest.min.js is the jQuery javascript library - written by John Resig and collaborators.
31+
http://docs.jquery.com/Licensing
32+
33+
Some of the icons used in the editor, and also supplied in the images/ folder are
34+
from the excellent Fam Fam Fam Silk icon collection by Mark James:
35+
http://www.famfamfam.com/lab/icons/silk/
36+
These are released under the Creative Commons Attribution 2.5 License
37+
http://creativecommons.org/licenses/by/2.5/

Weathermap.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please go to the <a href="editor.php">editor</a> to manage your Weathermaps

Weathermap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
class Weathermap {
4+
5+
public function menu() {
6+
echo('<li><a href="plugin/p='.get_class().'">'.get_class().'</a></li>');
7+
}
8+
9+
}
10+
11+
?>
12+

check-gdbug.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
ob_start();
3+
4+
if(isset($argv))
5+
{
6+
$env = "CLI";
7+
}
8+
else
9+
{
10+
$env = "WEB";
11+
}
12+
13+
print wordwrap("Some version of the GD graphics library have a bug in their handling of Alpha channels. Unfortunately, Weathermap uses these to draw Nodes.");
14+
print ($env=='CLI'?"\n\n":"\n<p>");
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<p>");
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<p>");
21+
22+
print wordwrap("Let's see if you have the GD transparency bug...");
23+
print ($env=='CLI'?"\n\n":"\n<p>");
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<p>");
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<p>");
28+
print "Here we go...";
29+
print ($env=='CLI'?"\n\n":"\n<p>");
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<p>");
46+
?>

0 commit comments

Comments
 (0)