Cette installation requiert l'utilisation d'IPKG et que vous soyez connectés sous SSH en root.
Installation de IPKG:Pour ceux qui ne l'on pas:
Via l'interface de votre NAS.
Cacti nécessite MySQL, PHP, RRDTool, Net-SNMP, Perl, et un serveur web supportant PHP comme Apache.
Par défaut on prendra le MySQL du Nas qui est déjà installé.
Pour le Serveur Web idem on utilisera celui du Nas.
ipkg update ipkg upgrade
ipkg list_installed
ipkg install php-mysql ipkg install rrdtool ipkg install net-snmp ipkg install perl
Ensuite installer PMA (php my admin) créer une base de donnée avec comme nom cactiDB
puis le user qui va bien avec CactiUser.
Mettre tout les droits de CactiUser sur la DB sauf le droit 'GRANT'.
Après avoir téléchargé la dernière release de Cacti ici décomprésser le tout dans Web\ .
Patcher si besoin puis ne pas Oublier de mettre les droits en full sur ces deux répertoires
au nom de celui qui y accède.
chown -R admin:administrators /share/MD0_DATA/web/cacti/rra /share/MD0_DATA/Web/cacti/log
Droits full pour le user cacti du groupe cactigrp sur rep /rra et /log.
nano /share/MD0_DATA/Web/cacti/include/config.php
$database_default = "cactiDB"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "xxxxxxxx";
nano /usr/local/apache/conf/apache.conf
vérifer que ces lignes y sont bien
AddType application/x-tar .tgz AddType application/x-httpd-php .php AddType image/x-icon .ico DirectoryIndex index.php index.html
nano /opt/etc/php.ini
Memory_Limit: memory_limit = 16M;
/opt/bin/php /share/MD0_DATA/Web/cacti/poller.php
Si vous avez l'erreur “sh -q” éditer ces fichiers:
nano /share/MD0_DATA/Web/cacti/resource/script_queries/host_cpu.xml
Modifier la ligne:
<script_path>|path_php_binary| -q |path_cacti|/scripts/query_host_cpu.php</script_path>
par
<script_path>|path_php_binary| |path_cacti|/scripts/query_host_cpu.php</script_path> nano /share/MD0_DATA/Web/cacti/resource/script_queries/host_disk.xml
Modifier la ligne:
<script_path>|path_php_binary| -q |path_cacti|/scripts/query_host_disk.php</script_path>
par
<script_path>|path_php_binary| |path_cacti|/scripts/query_host_disk.php</script_path>
Si l'option -w n'est pas supportée, modifier la ligne dans le fichier:
nano /share/MD0_DATA/Web/cacti/scripts/linux_memory.pl
Modifier:
cat /proc/meminfo | grep -w $ARGV[0] |");
par
cat /proc/meminfo | grep $ARGV[0] |");
Puis ajouter
/opt/bin path to the file /share/MD0_DATA/Web/cacti/install/index.php nano /share/MD0_DATA/Web/cacti/install/index.php
Modifier la ligne:
$search_paths = array("/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", "/usr/local/sbin");
par
$search_paths = array("/opt/bin", "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", "/usr/local/sbin");
Au besoin ajouter une hôte virtuel:
nano /usr/local/apache/conf/apache.conf
<VirtualHost *:80> ServerName 192.168.1.253 ou ( ip du nas) DocumentRoot "/share/MD0_DATA/Web/cacti" ErrorLog /usr/local/apache/logs/cacti/error.log LogLevel warn CustomLog /usr/local/apache/logs/cacti/access.log combined ServerSignature Off <DirectoryMatch /share/MD0_DATA/Web/cacti> Options FollowSymLinks AllowOverride None order allow,deny allow from all </DirectoryMatch> </VirtualHost>
Redémarrer le service Web:
/etc/init.d/Qthttpd.sh restart
Voici la dernière étape qui consiste à créer une tâche planifiée tout les 5 min pour éxecuter le poller.php de cacti.
nano /etc/config/crontab */5 * * * * /opt/bin/php /share/MD0_DATA/Web/cacti/poller.php >/dev/null 2>&1
/etc/init.d/crond.sh restart