Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jul 20, 2019 2:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to Cacti & PA2.5 on Debian Stable
PostPosted: Mon Nov 23, 2009 8:30 am 
Offline

Joined: Mon Nov 23, 2009 8:05 am
Posts: 1
Hi,
I don't know if there is already an How To, but this is mine.
/!\Today, I've seen that Plugin Achitecture 2.6 was released, this HOW-TO doesn't work with this version, I'm working on the 2.6 and will try to adapt the How-To

Installation of Cacti & Plugin Architecture 2.5 on Debian Stable.

The Plugin Architecture is only compatible with the latest version of Cacti which is available in the Testing Repository but for a server it's better to have the stability of Debian Stable, so we're going to create a mixed system with an apt-pinning.
1. Apt Pinning
    1.Create the file /etc/apt/apt.conf and type this text:
Code:
APT::Default-Release "stable";

    2.Edit /etc/atp/sources.list and add the testing repos
Code:
deb http://ftp.fr.debian.org/debian/ testing main non-free contrib
deb-src http://ftp.fr.debian.org/debian/ testing main non-free contrib

    3.Create the file /etc/apt/preferences and add this text
Code:
Package: cacti
Pin: release a=testing
Pin-Priority: 900

Package: *
Pin: release a=stable
Pin-Priority: 700

    4.Update your package database (apt-get update), and install cacti with
Code:
apt-get install cacti/testing

2.Apply the Plugin Architecture
Code:
wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7e-PA-v2.6.zip

    and extract it in the current directory (7z x cacti-plugin-0.8.7e-PA-v2.6.zip)
    2.Edit the file « cacti-plugin-0.8.7e-PA-v2.5.diff »
    At line 413 replace
    Code:
    +$config['url_path'] = '/';

    by
    Code:
    +$config['url_path'] = '/cacti/';

    And at line 436 replace
    Code:
    include($config["library_path"] . "/adodb/adodb.inc.php");

    by
Code:
include("/usr/share/php/adodb/adodb.inc.php");

    3.Now go to /usr/share/cacti/site (cd /usr/share/cacti/site) and simulate patch installation :
    Code:
    patch -p1 -N --dry-run <  /path/to/cacti-plugin-0.8.7e-PA-v2.5.diff

    if there is NO error, you can apply the patch
    Code:
    patch -p1 -N <  /path/to/cacti-plugin-0.8.7e-PA-v2.5.diff
    4.Finally, apply the sql patch :
Code:
mysql -u cacti -p cacti < path/to/pa.sql

    5.Now you can go on Cacti Website->User Management → admin → Realm Permissions and tick Plugin Management.
    You can add plugin by extracting them in /usr/share/cacti/site/plugins
Voilà.



Et Maintenant pour les Français:
1.Installation
Il faut installer la dernière version de Cacti, en effet le plugin architecture (PA) qui permet d'implémenter d'autre plugin n'est compatible qu'avec la dernière release, il n'est pas rétro compatible et les anciennes version ne sont pas disponible(souhait du développeur de PA).
La dernière version de Cacti est disponible pour sur les releases Testing et Unstable de Debian. Il est cependant toujours préférable d'installer une Debian Stable sur un serveur, il faudra donc installer un package de la version Testing dans notre version stable.
1.Mettre en place un système mixé (Apt Pinning)
    1.Il faut créer le fichier /etc/apt/apt.conf et ajouter la ligne
Code:
APT::Default-Release "stable";


    2.Puis dans le fichier /etc/apt/sources.list il faut ajouter les repos Testing
Code:
deb http://ftp.fr.debian.org/debian/ testing main non-free contrib
deb-src http://ftp.fr.debian.org/debian/ testing main non-free contrib


    3.Enfin créer le fichier /etc/apt/preferences avec les lignes suivants:
Code:
Package: cacti
Pin: release a=testing
Pin-Priority: 900

Package: *
Pin: release a=stable
Pin-Priority: 100

    4.Mettre à jour ses paquets apt-get update
    Enfin lancer la commande:
    Code:
    apt-get install cacti/testing


    La version testing de Cacti s'installera et sera normalement mise à jour à chaque upgrade.

2.Installation du Plugin Architecture

    2.On édite le fichier cacti-plugin-0.8.7e-PA-v2.5.diff
    À la ligne 413, remplacez
    Code:
    +$config['url_path'] = '/';

    par
    Code:
    +$config['url_path'] = '/cacti/';

    Et à la ligne 436, on remplace la ligne
    Code:
    include($config["library_path"] . "/adodb/adodb.inc.php");

    par
    Code:
    include("/usr/share/php/adodb/adodb.inc.php");


    3.On va dans le répertoire du site de Cacti: cd /usr/share/cacti/site/ et on simule l'exécution du patch
    Code:
    patch -p1 -N --dry-run <  /chemin/vers/cacti-plugin-0.8.7e-PA-v2.5.diff

    Si aucune erreur ne s'affiche, on peut appliquer le patch
    Code:
    patch -p1 -N <  /chemin/vers/cacti-plugin-0.8.7e-PA-v2.5.diff

    4.Dernière étape, la modification de la base de donnée. Retournez à l'endroit où vous avez extrait le Plugin Architecture, puis exécuter la commande
    Code:
    mysql -u cacti -p cacti < /chemin/vers/pa.sql


Vous pouvez aller maintenant sur la page de votre site http://@IP/cacti/
répondez aux première question, puis aller dans User Management → admin → Realm Permissions.
Activez Plugin Management.

Pour rajouter des plugins, il faut extraire les fichiers dans /usr/share/cacti/site/plugins/


Voilà.



I'm not sure about the Apt Pinning section, it's working but I don't know what will happen when the Testing version will be updated : according to all stuff i've read, Cacti will be upgraded correctly...

edit: Oh..There is an "How-To" section, if an admin could move the topic... :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group