Rechercher dans la communauté
Affichage des résultats pour les étiquettes 'monitoring'.
2 résultats trouvés
-
Il s'agit ici de présenter un tuto pour monitorer sa Freebox, avec les outils telegraf / influxdb / grafana, en complément du [TUTO] Monitoring NAS et Réseau qui reste la référence. En conséquence, je suppose déjà opérationnelle chez vous une chaine complète telegraf / influxdb / grafana pour la supervision de votre NAS Il faudra bien entendu faire les adaptations spécifiques à votre environnement. Principe : Le docker telegraf va utiliser un script python pour récupérer les infos de la Freebox. Limites : je n'ai pu valider cette méthode que sur ma Freebox, et donc pour les autres modèles et/ou configuration ... ? Freebox Révolution au dernier Firmware (4.0.7) à ce jour. Accès réseau fibre ftth (et donc pas testé les compteurs xDSL) Chaine existante (hypothèse) : je suppose donc que vous avez une chaine telegraf / influxdb / grafana opérationnelle pour votre NAS, en docker mode bridge. Ajout Freebox : On va rajouter un second docker telegraf, qui portera le script Python. Ce docker telegraf dédié Freebox va transmettre ses données vers une seconde database que l'on va créer dans le docker Influx Sur grafana, on créera une nouvelle source de données (la nouvelle database d'influx) qui nous permettra d'afficher les données Freebox. Voir schéma de principe ci-dessous : Configuration des dockers existants : subnet: 172.20.0.0/29 gateway: 172.20.0.1 ip_range: 172.20.0.0/29 Adressage existant grafana d2:ca:ab:cd:00:02 172.20.0.2 influxdb d2:ca:ab:cd:00:03 172.20.0.3 nas_telegraf d2:ca:ab:cd:00:04 172.20.0.4 Création du nouveau docker : fbx_telegraf Adressage sur le réseau bridge : fbx_telegraf d2:ca:ab:cd:00:05 172.20.0.5 Déclaration du service fbx_telegraf dans le docker-compose.yaml (extrait): EDIT du 02/septembre 2020 : la dernière branche de developpement du docker telegraf, 1.15.x, semble poser problème avec Python. Il faut donc se limiter au max à la version 1.14.5. L'image à charger sera donc telegraf:1.14.5 au lieu de telegraf:latest EDIT du 08/septembre 2020 : installation résolue pour python sur la branche telegraf 1.15.x (i.e. tag : latest). Voir détails plus bas. services: fbx_telegraf: image: telegraf:latest container_name: fbx_telegraf hostname: fbx_telegraf mac_address: d2:ca:ab:cd:00:05 networks: monitoring: ipv4_address: 172.20.0.5 environment: - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin:/usr/local:/usr/src - TZ=CET mem_limit: 75M volumes: - "/volume1/docker/monitoring/fbx_telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro" # pour le fichier de commande python d'acces a la freebox, # pour le fichier de commande python, # pour le fichier get-pip.py (install module pip puis requests) - "/volume1/docker/monitoring/fbx_telegraf/py:/usr/local/py" # pour le fichier log si on le met en place - "/volume1/docker/monitoring/fbx_telegraf/log:/usr/local/log" ports: - 9125:8125/udp - 9092:8092/udp - 9094:8094 restart: unless-stopped On notera la création et le mapping de 2 répertoires pour le docker fbx_telegraf: un répertoire pour le fichier Python et le fichier d'installation de l'utilitaire python "pip" : /usr/local/py un répertoire pour d’éventuels logs : /usr/local/log Création et démarrage du docker fbx_telegraf: docker-compose pull fbx_telegraf docker-compose up -d fbx_telegraf Via un accès ssh sur le NAS : mise à jour du docker fbx_telegraf docker exec -it fbx_telegraf apt update docker exec -it fbx_telegraf apt upgrade docker exec -it fbx_telegraf apt install -y software-properties-common Installation de python3 dans le docker telegraf télécharger get-pip.py (https://bootstrap.pypa.io/get-pip.py) dans le répertoire /usr/local/py installation des modules pip et requests docker exec -it fbx_telegraf wget https://bootstrap.pypa.io/get-pip.py docker exec -it fbx_telegraf python3 get-pip.py --prefix=/usr/local docker exec -it fbx_telegraf python3 -m pip install requests docker exec -it fbx_telegraf pip install unidecode EDIT du 08/septembre 2020 : installation Python sur la branche telegraf:1.5.x (i.e. tag latest) Au lieu des 7 commandes ci-dessus, on procèdera de la sorte : docker exec -it fbx_telegraf apt update docker exec -it fbx_telegraf apt upgrade docker exec -it fbx_telegraf dpkg --configure -a docker exec -it fbx_telegraf apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common docker exec -it fbx_telegraf wget https://bootstrap.pypa.io/get-pip.py docker exec -it fbx_telegraf apt-get install python3-distutils docker exec -it fbx_telegraf python3 get-pip.py --prefix=/usr/local docker exec -it fbx_telegraf python3 -m pip install requests docker exec -it fbx_telegraf pip install unidecode Il se peut que vous ayez une erreur du type : E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem Dans ce cas, .... suivre à la lettre la consigne et lancer donc la commande # dpkg --configure -a . Puis poursuivre normalement Script Python : On place le script Python fbx_telegraf_059.py dans le répertoire /usr/local/py (ce script a été mis à jour pour mes propres besoins. N’hésitez pas à le reprendre, en particulier en fonction de l'API Freebox si il vous manque des éléments) EDIT du 27/04/2021 : mise à jour du fichier python en version ed061. version basée sur l'API V8 de FreeboxOs compatibilité avec Freebox POP je conseille de repartir d'une database InfluxDB vierge cf message en page 9 pour plus de détails c'est par ici : https://github.com/bruno78310/Freebox-Revolution-Monitoring.git Modification du fichier de configuration telegraf : 1) Dans la section "Input Plugin" : ############################################################################### # INPUT PLUGINS # ############################################################################### ############################################################################### # INPUT PLUGINS FREEBOX # ############################################################################### # Read metrics from one or more commands that can output to stdout [[inputs.exec]] ## Commands array # commands = [ "python3 /usr/local/py/freebox_059.py -SPHDIWX" ] ## Timeout for each command to complete. timeout = "5s" ## Data format to consume. ## Each data format has it's own unique set of configuration options, read ## more about them here: ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md # data_format = "graphite" data_format = "influx" A noter : le script python "freebox_059.py" est lancé avec un certain nombre d'options, chacune correspondant à un groupe de données récupérées. Si on n'a pas besoin de toutes ces données, selon les besoins, il est tout à fait possible de supprimer les options que l'on ne souhaite pas grapher. freebox_059.py -SPHDIWX : S : état du switch 4 ports X : liste les hosts connectés P : état des ports du switch H : system status D : status disque interne I : status des interfaces LAN W : status du Wifi 4 : status aggregation xdsl / 4g 2) modification de la base influxdb cible, section "Output Plugins" : On va envoyer nos données vers une base de données du nom de fbx_database, user fbx_databse, password fbx_database De plus, on va créer nous même cette database => skip_database_creation = true ############################################################################### # OUTPUT PLUGINS # ############################################################################### # Configuration for sending metrics to InfluxDB [[outputs.influxdb]] ## The full HTTP or UDP URL for your InfluxDB instance. ## ## Multiple URLs can be specified for a single cluster, only ONE of the ## urls will be written to each interval. # urls = ["unix:///var/run/influxdb.sock"] # urls = ["udp://127.0.0.1:8089"] urls = ["http://influxdb:8086"] ## The target database for metrics; will be created as needed. ## For UDP url endpoint database needs to be configured on server side. database = "fbx_telegraf" ## The value of this tag will be used to determine the database. If this ## tag is not set the 'database' option is used as the default. database_tag = "" ## If true, the database tag will not be added to the metric. # exclude_database_tag = false ## If true, no CREATE DATABASE queries will be sent. Set to true when using ## Telegraf with a user without permissions to create databases or when the ## database already exists. skip_database_creation = true ## Name of existing retention policy to write to. Empty string writes to ## the default retention policy. Only takes effect when using HTTP. retention_policy = "" ## Write consistency (clusters only), can be: "any", "one", "quorum", "all". ## Only takes effect when using HTTP. write_consistency = "any" ## Timeout for HTTP messages. timeout = "30s" ## HTTP Basic Auth username = "fbx_telegraf" password = "fbx_telegraf" ## HTTP User-Agent # user_agent = "telegraf" On redémarre le docker fbx_telegraf pour prise en compte Création de la database fbx_telegraf sur influxdb Se connecter en console sur le docker influxdb, puis créer la database : root@influxdb:/# influx -username admin -password admin Connected to http://localhost:8086 version 1.7.9 InfluxDB shell version: 1.7.9 > show databases name: databases name ---- _internal nas_telegraf > create database fbx_telegraf > use fbx_telegraf Using database fbx_telegraf > create user fbx_telegraf with password 'fbx_telegraf' > grant all on fbx_telegraf to fbx_telegraf > > show databases name: databases name ---- _internal nas_telegraf fbx_telegraf > show users user admin ---- ----- admin true nas_telegraf false fbx_telegraf false > On redémarre le docker influxdb pour prise en compte. Autorisation de l'application sur le Freebox. il faut autoriser l'application sur la Freebox. Pour cela se placer dans une console fbx_telegraf et aller dans le dossier /usr/local/py root@fbx_telegraf:/usr/local/py# python3 freebox_059.py -h usage: freebox_050.py [-h] [-s] [-r] [-n app_name] [-i app_id] [-d device_name] [-f format] [-e endpoint] [-S] [-P] [-H] [-D] [-L] [-W] [-I] [-X] optional arguments: -h, --help show this help message and exit -s, --register-status Get register status -r, --register Register app with Freebox API -n app_name, --appname app_name Register with app_name -i app_id, --appid app_id Register with app_id -d device_name, --devicename device_name Register with device_name -f format, --format format Specify output format between graphite and influxdb -e endpoint, --endpoint endpoint Specify endpoint name or address -S, --status-switch Get and show switch status -P, --status-ports Get and show switch ports stats -H, --status-sys Get and show system status -D, --internal-disk-usage Get and show internal disk usage -L, --lan-config Get and show LAN config -W, --wifi-usage Get and show wifi usage -I, --lan-interfaces Get and show lan interfaces -X, --interfaces-hosts Get and show interfaces hosts On va demander d'enregistrer notre application sur la Freebox: root@fbx_telegraf:/usr/local/py# python3 freebox_059.py -r => il faut valider sur l'ecran LCD de la Freebox. => le nom de l'application codée dans le fichier fbx_telegraf_059.py est : grafanamonitor. => controler sur la Freebox que l'application a bien été acceptée : Paramètres / Gestion des Accès / Applications on peut aussi vérifier sur la console fbx_telegraf : root@fbx_telegraf:/usr/local/py# python3 freebox_059.py -s Status: auth already done root@fbx_telegraf:/usr/local/py# root@fbx_telegraf:/usr/local/py# python3 freebox_059.py -r Already registered, exiting root@fbx_telegraf:/usr/local/py# Vous trouverez alors un fichiers .credentials dans le répertoire /usr/local/py . A partir de là, fbx_telegraf est en mesure de collecter les données sur la Freebox, et de les envoyer sur la base de données fbx_telegraf du docker influxdb. on peut contrôler à la main que les valeurs sont bien accessibles, par exemple : root@fbx_telegraf:/usr/local/py# python3 freebox_059.py -H | grep System freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL sys_uptime_val=2787529 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL uptime="32 jours 6 heures 18 minutes 49 secondes" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL firmware_version="4.2.5" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL board_name="fbxgw2r" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL disk_status="active" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL user_main_storage="Disque dur" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_ext_telephony=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_speakers_jack=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL wifi_type="2d4_5g" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL pretty_name="Freebox Server (r2)" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL customer_hdd_slots=0 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL name="fbxgw-r2/full" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_speakers=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL internal_hdd_size=250 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_femtocell_exp=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_internal_hdd=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=NULL,tag3=NULL has_dect=True freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Fan,tag3=NULL id="fan0_speed" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Fan,tag3=NULL name="Ventilateur 1" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Fan,tag3=NULL value=2436 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_hdd id="temp_hdd" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_hdd name="Disque dur" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_hdd value=36 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_sw id="temp_sw" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_sw name="Temperature Switch" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_sw value=48 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpum id="temp_cpum" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpum name="Temperature CPU M" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpum value=58 freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpub id="temp_cpub" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpub name="Temperature CPU B" freebox,endpoint=mafreebox.freebox.fr,tag1=System,tag2=Sensor,tag3=temp_cpub value=53 root@fbx_telegraf:/usr/local/py# Dans la console du docker influxdb, on verifie que l'on recoit bien les données de nas_telegraf et fbx_telegraf Grafana : sur grafana, definir une nouvelle source de données : Name : InfluxDB-1 Freebox (example) URL : http://@NAS:8086 (comme pour le nas_telegraf,car c'est le même docker influxdb) Access : serveur Basic auth : yes Basic auth details : user : fbx_telegraf password : fbx_telegraf Database : fbx_telegraf User : fbx_telegraf password : fbx_telegraf http method : GET On valide (SAVE & TEST) et ce doit être OK. Il ne reste plus qu'à créer le ou les Dashboard souhaités ! => Ne pas oublier de préciser l'origine des données : InfluxDB-1 Freebox Pour ma part, j'ai réalisé: un Dashboard général (trafic, CPU, status des ports du switch, températures ....) un Dashboard listant les stations actives (globales et Wifi) Resterait à faire : l'API de la Freebox est accessible ici en http. Je n'ai pas réussi par manque de connaissances à passer en https je n'ai pas regardé du tout le cas d'un accès xDSL .... le script python s'appuie sur l'API V8 de la Freebox, et est donc compatible avec les Freebox Revolution et POP. La description de cet API peut se trouver ici : https://dev.freebox.fr/sdk/os/# Enfin, tous les paramètres disponibles n'ont pas forcement été implémentés dans le script. Mais les principaux sont là. SI il y avait un besoin particulier, faites le moi savoir. Freebox-1585840825569.json Liste stations FreeBox-1585840845020.json freebox_054.py freebox_058.py
-
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
- 508 réponses
-
- livebox
- monitoring
-
(et 1 en plus)
Étiqueté avec :