Install weathermap plugin for cacti

Weathermap setup

As with other plugins, you’ll need to download the plugin and put it into your
plugins directory.  Also make sure that it is chowned to the www­data user.

$ cd /var/www/cacti/plugins
$ sudo wget http://www.network­-weathermap.com/files/php-­weathermap-0.97c.zip
$ sudo apt­get install unzip
$ sudo unzip php­weathermap­0.97c.zip
$ sudo chown ­R www­data:www­data weathermap
$ sudo nano weathermap/editor.php

In order to make the weathermap browser editor available, we have to enable it.
Change the false to a true and save the file.  The reason that the editor is not
activated by default is because it does not fall under cacti’s login umbrella.  This
means that anybody would be able to get into the editor without logging in.
Next we will fix this by using apache’s .htaccess to require a username/password
to get into the editor.

// so that you can't have the editor active, and not know about it.
$ENABLED=true;
if(! $ENABLED)
{

Back on the browser, we want to navigate to the Configuration:plugin
Management section.  You will then see Weathermap listed with a blue arrow
pointing down.  Click the blue arrow to finish the installation.  After clicking on
the blue arrow, you will see that the weathermap tab is created.

for centos we will to disable selinux

#setenforce 0   =>disable selinux one time
#yum install php-gd gd-devel

Trouble Shoot:

error-meassage:

Apr 21 13:00:02 xm9202-cacti php: PHP Deprecated:  mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /var/www/html/cacti-0.8.8f/plugins/weathermap/lib/poller-common.php on line 91
Apr 21 13:00:02 xm9202-cacti php: PHP Deprecated:  mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /var/www/html/cacti-0.8.8f/plugins/weathermap/lib/poller-common.php on line 268
Apr 21 13:00:02 xm9202-cacti php: PHP Deprecated:  mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /var/www/html/cacti-0.8.8f/plugins/weathermap/lib/poller-common.php on line 269

=>fixed: by go to changed file 
#var/www/html/cacti-0.8.8f/plugins/weathermap/lib/poller-common.php with every line number
==========================================
message alert when go to weathermap and create node or other:

Apr 21 16:03:04 xm9202-cacti httpd: PHP Deprecated:  Function split() is deprecated in /var/www/html/cacti-0.8.8f/plugins/weathermap/editor.php on line 32
=>fixed:
I replaced the split() function with explode() and it works normally now.

I changed
$parts = split(":",
to
$parts = explode(":",
===========================
PHP Warning:  fopen(/var/www/html/cacti-0.8.8f/plugins/weathermap/output/weathermap.permissions.test): failed to open stream: Permission denied in /var/www/html/cacti-0.8.8f/plugins/weathermap/lib/poller-common.php on line 100

=>fixed:
#chown -R cacti /var/www/html/cacti/plugins/weathermap/output/

=================================
Debian8:

Trouble shoot:

04/23/2016 11:30:02 AM - WEATHERMAP: Poller[0] WARNING: Output directory (/var/www/html/cacti/plugins/weathermap/output) isn't writable (tried to create '/var/www/html/cacti/plugins/weathermap/output/weathermap.permissions.test'). No maps created. You probably need to make it writable by the poller process (like you did with the RRA directory) [WMPOLL06]

04/23/2016 11:30:02 AM - WEATHERMAP: Poller[0] STATS: Weathermap 0.97c run complete - Sat, 23 Apr 16 11:30:02 +0800: 0 maps were run in 0 seconds with 1 warnings. (Permissions problem prevents any maps running WMPOLL06)

=>fixed:
#chown -R cacti /var/www/html/cacti/plugins/weathermap/output/
==============================================
01/06/2010 10:53:35 AM - WEATHERMAP: Poller[0] WARNING: [Map 6] simple.conf: Using a non-existent special font (100) - falling back to internal GD fonts [WMWARN03]

=>solve by:
[WMWARN03]

 "Using a non-existent special font (fontnumber) - falling back to internal GD fonts "

 If you use a font number that doesn't exist by default(e.g. larger than 5), and you haven't got a valid FONTDEFINE line, then you will get this error. Weathermap will use font 5 instead of the font you asked for.

edit file:
#vim /var/www/html/cacti/plugins/weathermap/configs/xm.conf

verify FONTDEFINE 10 and KEYFONT 10 is the same

FONTDEFINE 10 docs/example/Vera.ttf 10

WIDTH 950
HEIGHT 625
HTMLSTYLE overlib
KEYFONT 10
TITLE xingmu-network
TIMEPOS 746 17 Created: %b %d %Y %H:%M:%S
.................
=================================================
Reference: