#http://openmaniak.com/cacti.php
#http://blog.it4me.se/?p=131
#http://58.96.99.76/joomla/index.php/tech-a-it-stuff/networking-other/66-cacti-plugin-architecture-install-on-ubuntu
#http://www.network-weathermap.com/manual/latest/pages/install-cacti-editor.html
sudo -s
mkdir cacti_weathermap
cd cacti_weathermap
apt-get install cacti-spine
wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
tar xvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip
unzip php-weathermap-0.97a.zip
cd cacti-plugin-arch/files-0.8.7g
sudo cp -R * /usr/share/cacti/site/
cd ..
mysql cacti < pa.sql -u root -p
sudo nano /usr/share/cacti/site/include/global.php
#row 107:
$config["rra_path"] = $config["base_path"]."/rra";
#change it to:
$config["rra_path"] = '/var/lib/cacti/rra';
#row 197
include($config["library_path"]."/adodb/adodb.inc.php");
#change it to:
include("/usr/share/php/adodb/adodb.inc.php");
#row 100
$config['url_path'] = $url_path;
#change to
$config['url_path'] = '/cacti/';
#below row 42 $cacti_session_name = "Cacti"; add
/* Weathermap */
$plugins = array();
$plugins[] = 'monitor';
$plugins[] = 'weathermap';
#save and quit
sudo chmod 644 /usr/share/cacti/site/lib/plugins.php
sudo chmod 644 /usr/share/cacti/site/include/plugins.php
cd ..
mv weathermap/ /usr/share/cacti/site/plugins
chown -R www-data:www-data /usr/share/cacti/site/plugins
mv /usr/share/cacti/site/plugins/weathermap/editor-config.php-dist /usr/share/cacti/site/plugins/weathermap/editor-config.php
nano /usr/share/cacti/site/plugins/weathermap/editor-config.php
//$cacti_base = 'C:/httpd-.2_x64/htdocs/cacti';
$cacti_base = ‘/usr/share/cacti/site’;
//$cacti_url = "http://support.company.net/cacti/";
$cacti_url = "http://localhost/cacti/";
chmod u+w /usr/share/cacti/site/plugins/weathermap/configs
#Now we need to secure the editor
nano /etc/apache2/conf.d/weathermap
<Directory /usr/share/cacti/site/plugins/weathermap>
<Files editor.php>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Files>
</Directory>
/etc/init.d/apache2 restart
nano /usr/share/cacti/site/plugins/weathermap/editor.php
#change
$ENABLED=false;
#to
$ENABLED=true;
#change
$cacti_base = 'C:/httpd-.2_x64/htdocs/cacti';
#to
$cacti_base = '/usr/share/cacti/site';
#change
$cacti_url = "http://support.company.net/cacti/";
#to
$cacti_url = "http://localhost/cacti/";