Linux:Configuration de Cacti

De WIKI.minetti.org
Aller à : navigation, rechercher

But

Cacti est un logiciel de supervision qui permet de représenter graphiquement dans le temps l'évolution de certains métriques.

Étape préliminaire

Avant de commencer, il est impératif:

Installation sur une CentOS

  • Créé le fichier /etc/yum.repos.d/epel.repo suivant:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
  • Taper la commande suivante pour installer Cacti:
yum install cacti

Configuration

  • Editer le fichier /etc/httpd/conf.d/cacti.conf pour autoriser le accès à partir du LAN:
...
<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from 192.168.0.0/24
</Directory>
...
  • Taper la commande suivante:
apachectl graceful
  • Créer la base de données en tapant les commandes suivantes:
cd /usr/share/doc/cacti-0.8.7i/
mysql -u root -p
CREATE DATABASE cacti;
CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `cacti`.* TO 'cacti'@'localhost';
flush privileges;
use cacti;
source cacti.sql;
quit
  • Editer le fichier /etc/cacti/db.php et s'assurer qu'il ressemble à ceci:
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "....";
$database_port = "3306";
$database_ssl = false;
  • Décommenter la ligne du fichier /etc/cron.d/cacti:
*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
  • Relever la version de Net-SNMP en tapant la commande suivante:
rpm -qa net-snmp
  • Relever la version de RRDTool en tapant la commande suivante:
rpm -qa rrdtool
  • Dans un navigateur, taper l'URL https://www.srv.minetti.org/cacti/:
    • Cliquer sur le bouton Next.
    • Sélectionner le type d'installation New Install et cliquer sur le bouton Next.
    • Vérifier que toutes les commandes ont été trouvés (présence de [FOUND] en vert).
    • Indiquer les bonnes versions pour Net-SNMP et RRDTool.
    • Cliquer sur le bouton Finish.
    • S'identifier avec l'utilisateur admin et mot de passe admin.
    • Changer le mot de passe.