A DATER DU 06/02/2022 CE MESSAGE AINSI QUE LES DEUX QUI SUIVENT ET CEUX VERS LESQUELS ILS POINTENT SONT "HISTORIQUES"; UN NOUVEAU TUTORIEL EST DISPONIBLE PLUS LOIN DANS CE FIL DE DISCUSSION (ICI). LES MESSAGES "HISTORIQUES" SONT CONSERVÉS A TITRE D'INFORMATION.
-----
Tutoriel complet et opérationnel
des tutoriels complémentaires sont disponibles plus loin dans le fil de discussion:
installation de l'architecture de plugins (ici), installation du plugin Settings (ici), installation du plugin Syslog (ici), récupération des logs d'Apache (ici), visualisation des informations SMART (ici), templates pour le monitoring des bases MySQL (ici), procédures relatives avec la mise à jour du firmware du Synology (ici), mise à jour de Cacti (ici), mise à jour de l'architecture de plugins et mise à jour des plugins suite à la mise à jour de Cacti (ici), géolocalisation des adresses IP sous le plugin Syslog (ici)
-----
NOTE IMPORTANTE: Ce tutoriel a été originellement réalisé avec le firmware 728 et Cacti 0.8.7b. Depuis le firmware a évolué, Cacti aussi, ainsi que les paquets IPKG requis. Cependant, l'installation de Cacti est très largement indépendante de la version de Cacti ou même du firmware de vos Synology. A cet égard, vous trouverez dans ce tutoriel des informations complémentaires ou alternatives (en violet) pour réaliser les différentes installations avec les dernières versions du firmware et/ou de Cacti.
-----
Bonjour à toutes et à tous.
Cacti est LA plateforme de monitoring de votre Synology et plus largement de votre réseau.
C'est donc avec un plaisir certain (mais aussi une certaine fierté, j'ai vaincu la bête!) que je vous fais part de ce "petit" tutoriel. Il est certes un peu long mais il est tout public, pas besoin d'être expert sauf du ctrl+c/clic-droit (il n'y a, à peu de choses près, qu'à copier les commandes listées et les "coller" dans une fenêtre Telnet). Si vous avez des doutes et/ou questions, ce fil de discussion est là pour les accueillir. Seuls les trois premiers messages de ce fil de discussion sont utiles pour installer Cacti; ils intègrent les échanges présents dans ce fil de discussion et ayant engendré des mises à jour. Vous n'avez donc pas à lire en détail l'ensemble du fil de discussion. Des tutoriels supplémentaires, référencés ci-dessus, sont proposés en vue d'augmenter les fonctionalités de Cacti.
-----
Tutoriel d'installation de Cacti (0.8.7*) (http://cacti.net/index.php) sur un Synology DS107
Version du noyau Linux : 2.4.22-uc0
Firmware : DSM 2.0-0728
Tutoriel applicable à n'importe quelle version de firmware.
-----
Pré-requis:
Cette installation requiert l'utilisation d'IPKG et que vous soyez connectés sous Telnet en root.
Installation des composants de base:
Cacti nécessite MySQL, PHP, RRDTool, Net-SNMP, Perl, et un serveur web supportant PHP comme Apache
Perl est déjà installé.
Apache est déjà installé mais pas forcément actif. Pour cela:
Dans l'interface d'administration aller à Services Réseau > Services Web, et activer Web Station.
Cocher aussi la case "Activer l'option de configuration PHP register_globals".
Pour ce qui est de MySQL, on préfèrera une nouvelle installation à celle du Synology, de même pour PHP (justifications données plus bas).
Pour ce qui est de RRDTool, et Net-SNMP, ils n'existent tout simplement pas sur le Synology. Il faudra donc les installer.
Note: les dernières versions du firmware incluent SNMP. Je conseille cependant d'installer Net-SNMP. Si vous décidez d'utiliser le SNMP de Synology merci de nous faire un retour.
Mise à jour de la liste des paquets IKPG
shell> ipkg update
Installation de rrdtool
shell> ipkg info rrdtool
Package: rrdtool
Version: 1.2.27-1
Depends: zlib, libpng, freetype, libart
Status: unknown ok not-installed
Section: misc
Architecture: powerpc
maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com>
MD5Sum: 701446a9b03bc18e365ec98ff9216e8a
Size: 681277
Filename: rrdtool_1.2.27-1_powerpc.ipk
Source: http://oss.oetiker.ch/rrdtool/pub//rrdtool-1.2.27.tar.gz
Description: Round-Robin Database tool. Database collator and plotter
Successfully terminated.
La dernière version en date est 1.2.30-1. Cela n'a aucune incidence. shell> ipkg install rrdtool
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/rrdtool_1.2.27-1_powerpc.ipk
Installing zlib (1.2.3-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/zlib_1.2.3-3_powerpc.ipk
Installing libpng (1.2.34-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libpng_1.2.34-1_powerpc.ipk
Installing freetype (2.3.6-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/freetype_2.3.6-1_powerpc.ipk
Installing libart (2.3.17-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libart_2.3.17-2_powerpc.ipk
Configuring freetype
Configuring libart
Configuring libpng
Configuring rrdtool
Configuring zlib
Successfully terminated.
Installation de net-snmp shell> ipkg info net-snmp
Package: net-snmp
Version: 5.4.2.1-1
Depends: openssl
Status: unknown ok not-installed
Section: net
Architecture: powerpc
maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com>
MD5Sum: b42247073b38a426722d1a317e158e2b
Size: 1550114
Filename: net-snmp_5.4.2.1-1_powerpc.ipk
Source: http://easynews.dl.sf.net/sourceforge/net-snmp/net-snmp-5.4.2.1.tar.gz
Description: net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6
Successfully terminated.
shell> ipkg install net-snmp
Installing net-snmp (5.4.2.1-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/net-snmp_5.4.2.1-1_powerpc.ipk
Configuring net-snmp
Successfully terminated.
Installation de php, mysql et php-mysql L'installation de PHP est nécessaire car Cacti requiert un binaire PHP pour exécuter des scripts alors que PHP, sur vos Synology, n'est installé que sous la forme d'un objet partagé (.so) chargé par Apache. Il semble par ailleurs qu'il faille installer PHP-MySQL car l'objet partagé mysql.so n'est pas présent dans le répertoire des extensions de PHP (une fois ce dernier installé), répertoire défini dans /opt/etc/php.ini:
extension_dir = /opt/lib/php/extensions
L'installation de PHP-MySQL mettra à disposition mysql.so. Malheureusement n'installer que PHP et PHP-MySQL ne suffira pas car il manquera d'autres objets partagés (.so). Pour remédier à cela il faudra installer MySQL. Par contre, il semble qu'il y ait des conflits entre le MySQL IPKG le MySQL du Synology. Il faut donc veiller à ce que MySQL ne soit pas activé dans l'interface d'administration du Synology. Je n'ai malheureusement pas de solution à ce point potentiellement bloquant pour certains, point qui est discuté plus bas dans la suite du fil de discussion. Dans le contexte d'IPKG, PHP et MySQL sont des dépendances de PHP-MySQL, on installera donc directement ce dernier: shell> ipkg info php-mysql
Package: php-mysql
Version: 5.2.8-1
Depends: php, mysql
Status: unknown ok not-installed
Section: net
Architecture: powerpc
maintainer: Josh Parsons <jbparsons@ucdavis.edu>
MD5Sum: 2cbff357195ad2ea88638ffb79740caa
Size: 69382
Filename: php-mysql_5.2.8-1_powerpc.ipk
Source: http://static.php.net/www.php.net/distributions//php-5.2.8.tar.bz2
Description: mysql extension for php
Successfully terminated.
La dernière version en date est 5.2.12-1. Cela n'a aucune incidence. shell> ipkg install php-mysql
Installing php-mysql (5.2.8-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/php-mysql_5.2.8-1_powerpc.ipk
Installing php (5.2.8-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/php_5.2.8-1_powerpc.ipk
Installing bzip2 (1.0.5-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/bzip2_1.0.5-1_powerpc.ipk
Installing libxml2 (2.7.2-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libxml2_2.7.2-1_powerpc.ipk
Installing libxslt (1.1.24-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libxslt_1.1.24-1_powerpc.ipk
Installing gdbm (1.8.3-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/gdbm_1.8.3-2_powerpc.ipk
Installing libdb (4.2.52-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libdb_4.2.52-3_powerpc.ipk
Installing pcre (7.8-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/pcre_7.8-1_powerpc.ipk
Installing libstdc++ (5.0.6-6) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/libstdc++_5.0.6-6_powerpc.ipk
Installing cyrus-sasl-libs (2.1.22-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/cyrus-sasl-libs_2.1.22-2_powerpc.ipk
Installing openldap-libs (2.3.43-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/openldap-libs_2.3.43-1_powerpc.ipk
Installing mysql (4.1.22-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/mysql_4.1.22-2_powerpc.ipk
Installing ncurses (5.7-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/ncurses_5.7-1_powerpc.ipk
Installing readline (5.2-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/readline_5.2-2_powerpc.ipk
Configuring bzip2
update-alternatives: Linking //opt/bin/bzip2 to /opt/bin/bzip2-bzip2
Configuring cyrus-sasl-libs
Configuring gdbm
Configuring libdb
Configuring libstdc++
Configuring libxml2
Configuring libxslt
Configuring mysql
Installing all prepared tables
090107 0:11:42 [Warning] Setting lower_case_table_names=2 because file system for /opt/var/lib/mysql/ is case insensitive
Fill help tables
090107 0:11:43 [Warning] Setting lower_case_table_names=2 because file system for /opt/var/lib/mysql/ is case insensitive
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/bin/mysqladmin -u root password 'new-password'
/opt/bin/mysqladmin -u root -h syno password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt; /opt/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench; perl run-all-tests
Please report any problems with the /opt/bin/mysqlbug script!
The latest information about MySQL is available on the web at http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL SUCCESS!
Configuring ncurses
update-alternatives: Linking //opt/bin/clear to /opt/bin/ncurses-clear
Configuring openldap-libs
Configuring pcre
Configuring php
Configuring php-mysql
Configuring readline
Successfully terminated.
Pour mémoire: shell> ipkg info mysql
Package: mysql
Version: 4.1.22-2
Depends: zlib, ncurses, openssl, readline, libstdc++
Status: install ok installed
Section: misc
Architecture: powerpc
maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com>
MD5Sum: 1c9b8738180b65830618b95b16e911b4
Size: 5242072
Filename: mysql_4.1.22-2_powerpc.ipk
Source: http://downloads.mysql.com/archives/mysql-4.1/mysql-4.1.22.tar.gz
Description: Popular free SQL database system
Successfully terminated.
shell> ipkg info php
Package: php
Version: 5.2.8-1
Depends: bzip2, openssl, zlib, libxml2, libxslt, gdbm, libdb, pcre, cyrus-sasl-libs, openldap-libs
Status: install ok installed
Section: net
Architecture: powerpc
maintainer: Josh Parsons <jbparsons@ucdavis.edu>
MD5Sum: d85e30893257b22d9150864d45f83063
Size: 1847224
Filename: php_5.2.8-1_powerpc.ipk
Source: http://static.php.net/www.php.net/distributions//php-5.2.8.tar.bz2
Description: The php scripting language
Successfully terminated.
Définition du mot de passe de root pour la base MySQL (IPKG)
MySQL intègre par défaut deux utilisateurs 'root' et '' (anonyme) qui n'ont pas de mot de passe associé: http://dev.mysql.com...privileges.html
Il est recommandé de définir un mot de passe pour l'utilisateur root (http://www.nas-forum...oot-et-anonyme/, voir aussi les messages affichés à l'écran lors de l'installation de MySQL via IPKG)
Dans les commandes qui vont suivre, remplacez password par le mot de passe que vous avez choisi et nom-hote par le nom d'hôte de votre Synology.
Pour savoir quel est votre nom d'hôte:
shell> cd /opt/bin
shell> ./mysql -u root
mysql> SELECT Host, User FROM mysql.user;
mysql> exit
Recherchez une ligne qui contient root dans la colonne User et quelque chose d'autre que localhost dans la colonne Host.
Pour mémoire, le MySQL du Synology se trouve là: /usr/syno/mysql/bin
shell> cd /opt/bin
shell> ./mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
mysql> SET PASSWORD FOR 'root'@'nom-hote' = PASSWORD('password');
mysql> FLUSH PRIVILEGES;
mysql> exit
A partir de ce point, il est considéré qu'un mot de passe a été défini pour le compte root de MySQL et donc l'option -p est utilisée dans les lignes de commande.
Note: Pour des questions de "sécurité", je vous engage à supprimer l'historique des commandes passées sous mysql, historique qui se trouve dans votre home (et donc /root)
shell> cd /root
shell> cat /dev/null > ~/.mysql_history
ou bien:
shell> cd /root
shell> $ > ~/.mysql_history