This is an old revision of the document!


supervision cacti

base systeme

# cat /etc/redhat-release 
CentOS Linux release 7.0.1406 (Core) 
[root@monitor ~]# uname -a 
Linux monitor.it-sudparis.eu 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

installation

# yum -y install mariadb-server php php-cli php-mysql net-snmp-utils rrdtool php-snmp gcc mariadb-devel net-snmp-devel autoconf automake libtool dos2unix 

Résumé de la transaction

Installation   14 Paquets (+33 Paquets en dépendance)

Taille totale des téléchargements : 59 M
Taille d'installation : 210 M 

serveur apache httpd

activation du service apache sous centos 7 (systemctl)

[root@monitor ~]# systemctl list-units -all | grep -i http
httpd.service loaded inactive dead      The Apache HTTP Server

[root@monitor ~]# systemctl enable httpd.service
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'


root@monitor ~]# systemctl list-units  | grep -i http
httpd.service loaded active running   The Apache HTTP Server 

firewalld

ref

[root@monitor ~]# firewall-cmd --get-active-zones
public
  interfaces: eth0
[root@monitor ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@monitor ~]# firewall-cmd --reload
success
[root@monitor ~]# firewall-cmd --list-services
dhcpv6-client http ssh
[root@monitor ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@monitor ~]# firewall-cmd --reload
success
[root@monitor ~]# firewall-cmd --list-services
dhcpv6-client http https ssh 

DB mariaDB

start

[root@monitor ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
[root@monitor ~]# systemctl list-units  --all | grep -i maria
mariadb.service loaded inactive dead      MariaDB database server
[root@monitor ~]# systemctl start mariadb.service
[root@monitor ~]# systemctl list-units  | grep -i maria
mariadb.service loaded active running   MariaDB database server 

configure and secure

[root@monitor ~]# /usr/bin/mysql_secure_installation 


Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Sorry, passwords do not match.

New password:  secret 
Re-enter new password: secret
Password updated successfully!
Reloading privilege tables..
 ... Success!


Remove anonymous users? [Y/n] Y
 ... Success!

Disallow root login remotely? [Y/n] n
 ... skipping.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

create DB

[root@monit ~]# mysqladmin -u root -p create cacti_monitor
Enter password: 

MariaDB [(none)]> GRANT ALL ON cacti_monitor.* TO usercacti@localhost IDENTIFIED BY 'secret';
Query OK, 0 rows affected (0.04 sec)

installation cacti 8.8c

[root@monitor ~]# wget http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz

[root@monitor html]# tar xvfz /root/cacti-0.8.8c.tar.gz
[root@monitor html]# ln -s cacti-0.8.8c/ cacti
[root@monitor html]# ls -l
total 4
lrwxrwxrwx.  1 root root    13 27 déc.  22:03 cacti -> cacti-0.8.8c/
drwxr-xr-x. 13 1000 users 4096 23 nov.  21:18 cacti-0.8.8c

[root@monitor html]# adduser cacti
[root@monitor html]# cd /var/www/html/cacti
[root@monitor cacti]# chown -R cacti.apache rra log
[root@monitor cacti]# chmod 775 rra log

[root@monitor cacti]# vim ./include/config.php

upgrade-recover data from old cacti

[root@monitor cacti]#  mysql -h localhost -u cactiuser -p cacti_monitor < /root/cacti_old_monitor-jp-2014-12-27-21h52.sql
Enter password:

copy rrd files

6 . Copy the *.rrd files from the old Cacti directory.

[root@monitor cacti]# cp -v -u /root/cacti/oldscripts/* ./scripts/
« /root/cacti/oldscripts/bind-stats.sh » -> « ./scripts/bind-stats.sh »
« /root/cacti/oldscripts/cacti_graph_template_postfix_queues_246.xml » -> « ./scripts/cacti_graph_template_postfix_queues_246.xml »
...

cacti 8.8c

update superlink

database pb

http://forums.cacti.net/viewtopic.php?f=14&t=48245

Finally solved.

mysql> drop table superlinks_auth;
mysql> drop table superlinks_pages;

and recreate the table manually to work

CREATE TABLE superlinks_pages(
id int(11) NOT NULL auto_increment,
sortorder int(11) NOT NULL default 0,
disabled char(2) NOT NULL default '',
contentfile text NOT NULL,
title text NOT NULL,
style varchar(10) NOT NULL DEFAULT 'TAB',
extendedstyle varchar(50) NOT NULL DEFAULT '',
imagecache varchar(60) NOT NULL DEFAULT '',
PRIMARY KEY (id)
) ENGINE=MyISAM;

CREATE TABLE superlinks_auth (
userid mediumint(9) NOT NULL default '0',
pageid int(11) NOT NULL default '0'
) ENGINE=MyISAM;

awaiting configuration

uninstall and reinstall

http://forums.cacti.net/viewtopic.php?f=14&t=45286

Just in case someone comes across this. In order to uninstall it and you cannot, then use this URL:

http://<cacti-server>/cacti/plugins.php?mode=uninstall&id=superlinks

blank graph

graph emtpty/ blanck after superlink install ⇒ comment jquery in plugin setup file

cf http://licanli2082.blogspot.fr/2014/12/cacti-088c-reportit-cause-graph-tree.html

[root@monit superlinks]# cp setup.php setup.php.orig
[root@monit superlinks]# vim setup.php 
function superlinks_page_head() {
        global $config;

//      print "<script type='text/javascript' src='".$config['url_path'] ."/plugins/superlinks/jquery-latest.min.js'></script>";

cf http://forums.cacti.net/viewtopic.php?f=14&t=30823&start=15

workaround:

[root@monit superlinks]# diff superlinks.php superlinks.php.orig 
53c53
< 		print '<iframe id="slcontent" src="' . $page['contentfile'] . '"width="100%" height="900px" frameborder="0"></iframe>';
---
> 		print '<iframe id="slcontent" src="' . $page['contentfile'] . '" frameborder="0"></iframe>';

plugin php-weathermap

[root@monit plugins]# wget http://network-weathermap.com/files/php-weathermap-0.97c.zip
[root@monit plugins]# unzip php-weathermap-0.97c.zip 
[root@monit plugins]# cd weathermap/
[root@monit weathermap]# chown apache output/
docpublic/reseaux/services/monitcacti.1427621544.txt.gz · Last modified: 2015/03/29 09:32 by procacci@tem-tsp.eu
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0