Outils pour utilisateurs

Outils du site


linux:zabbix (lu 23315 fois)

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
linux:zabbix [30-06-2014 13:23] edmc73linux:zabbix [14-10-2025 09:34] (Version actuelle) edmc73
Ligne 1: Ligne 1:
 ====== Zabbix ====== ====== Zabbix ======
 +
 ===== Installation ===== ===== Installation =====
  
Ligne 42: Ligne 43:
  
 Et ajouter un media email à votre profil. Et ajouter un media email à votre profil.
 +
 +==== Upgrade ====
 +
 +Si vous avez un message du genre 
 +  The Zabbix database version does not match current requirements. Your database version: 6010048. Required version: 7020000.
 +
 +  sudo mysql -u root -p
 +
 +<code>
 +MariaDB [(none)]> SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
 ++---------------------------------+-------+
 +| Variable_name                   | Value |
 ++---------------------------------+-------+
 +| log_bin_trust_function_creators | OFF   |
 ++---------------------------------+-------+
 +1 row in set (0,001 sec)
 +
 +MariaDB [(none)]> SET GLOBAL log_bin_trust_function_creators = 1;
 +Query OK, 0 rows affected (0,002 sec)
 +
 +MariaDB [(none)]> 
 +MariaDB [(none)]> SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
 ++---------------------------------+-------+
 +| Variable_name                   | Value |
 ++---------------------------------+-------+
 +| log_bin_trust_function_creators | ON    |
 ++---------------------------------+-------+
 +1 row in set (0,001 sec)
 +
 +MariaDB [(none)]> ^C
 +MariaDB [(none)]> ^DBye
 +root@:~# systemctl restart zabbix-server.service 
 +root@:~# vi /var/log/zabbix/zabbix_server.log
 +
 +743136:20251014:113001.933 starting automatic database upgrade
 +743136:20251014:113002.052 completed 2% of database upgrade
 +743136:20251014:113002.078 completed 4% of database upgrade
 +...
 +743136:20251014:113003.978 completed 98% of database upgrade
 +743136:20251014:113003.980 completed 100% of database upgrade
 +743136:20251014:113003.980 database upgrade fully completed
 +
 +</code>
  
 ===== Agent Zabbix ===== ===== Agent Zabbix =====
Ligne 120: Ligne 164:
 http://blog.les-titans.com/index.php/2013/04/monitoring-de-mysql-sur-zabbix/ http://blog.les-titans.com/index.php/2013/04/monitoring-de-mysql-sur-zabbix/
  
-===== I/O Stats =====+===== I/O Disk Stats =====
  
 http://www.denniskanbier.nl/blog/monitoring/monitoring-disk-io-using-zabbix/ http://www.denniskanbier.nl/blog/monitoring/monitoring-disk-io-using-zabbix/
 +
 +http://romain.novalan.fr/wiki/Monitor_a_device_performance_on_Linux_with_Zabbix
  
 ===== Windows ===== ===== Windows =====
Ligne 130: Ligne 176:
 ===== Installation sur synology ===== ===== Installation sur synology =====
  
-http://weblog.aklmedia.nl/2011/05/install-zabbix-agent-on-synology/+Trouvez le type de CPU de votre synology => http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have 
 + 
 +Pour installer ipkg => http://korben.info/installer-ipkg-sur-synology.html 
 + 
 +Sur certain NAS, on peut le trouver dans /opt/bin ou /opt/sbin 
 + 
 +Un tuto pour compiler zabbix http://weblog.aklmedia.nl/2011/05/install-zabbix-agent-on-synology/ 
 + 
 +A rajouter au tuto : 
 +Créer un utilisateur zabbix en éditant le /etc/passwd et /etc/group (je n'ai pas trouvé la commande adduser ou useradd) 
 +  echo 'zabbix:x:1200:200::/opt/zabbix:/bin/false' >> /etc/passwd 
 +  echo 'zabbix:x:200' >> /etc/group 
 + 
 +Lancez l'agent zabbix via la commande 
 +  /opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/conf/zabbix_agentd.conf 
 + 
 +On peut vérifier le bon fonctionnement avec ps 
 +<code>> ps | grep zabbix 
 +19600 zabbix    3040 S    ./zabbix_agentd -c /opt/zabbix/etc/zabbix_agentd.conf 
 +19601 zabbix    3040 S    ./zabbix_agentd: collector [idle 1 sec] 
 +19602 zabbix    3092 S    ./zabbix_agentd: active checks #1 [idle 1 sec] 
 +</code> 
 +et le fichier de log 
 +<code>> cat /tmp/zabbix_agentd.log  
 + 19600:20140708:160131.502 Starting Zabbix Agent [nas3]. Zabbix 2.2.4 (revision 46772). 
 + 19600:20140708:160131.503 using configuration file: /opt/zabbix/conf/zabbix_agentd.conf 
 + 19601:20140708:160131.507 agent #0 started [collector] 
 + 19602:20140708:160131.513 agent #1 started [active checks #1] 
 + 19602:20140708:160131.572 active check "system.distrib" is not supported 
 + 19602:20140708:160131.573 active check "system.hw.cpu" is not supported 
 +</code> 
 + 
 +Pour que zabbix-agent se lance au démarrage, j'ai rajouté le fichier suivant 
 +  vi /usr/syno/etc/rc.d/S99zabbix.sh 
 +<code bash> 
 +#!/bin/sh 
 +if [ "$1" = "start" -o "$1" = "" ]; then 
 + /opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/conf/zabbix_agentd.conf 
 +fi 
 +</code> 
 +  chmod +x /usr/syno/etc/rc.d/S99zabbix.sh 
 + 
 +et voila ! 
 + 
 +--- 
 + 
 +Suivant les NAS, ce tuto ne marchera pas. Dans ce cas téléchargez les binaires déjà compilés et fournis par zabbix => http://www.zabbix.com/download.php 
 + 
 +Regardez le type de processeur avec la commande 
 +  uname -a 
 +  Linux Nas 3.2.40 #4482 SMP Fri Apr 18 16:52:49 CST 2014 x86_64 GNU/Linux synology_bromolow_rs3412rpxs 
 + 
 +On range tout ça sans /opt/zabbix 
 +  mkdir /opt/zabbix 
 +  cd /opt/zabbix 
 +  wget http://www.zabbix.com/downloads/2.2.5/zabbix_agents_2.2.5.linux2_6_23.amd64.tar.gz 
 +  tar zxvf zabbix_agents_2.2.5.linux2_6_23.amd64.tar.gz 
 + 
 +Créer un utilisateur zabbix 
 +  echo "zabbix:x:1200:200::/opt/zabbix:/bin/false" >> /etc/passwd 
 + 
 +Modifier le fichier de config et lancé la commande 
 +  /opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/conf/zabbix_agentd.conf 
 + 
 +Vérifier le bon fonctionnement 
 +  > ps w | grep zabbix   
 +  30271 zabbix   18384 S    /opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/conf/zabbix_agentd.conf 
 +  30272 zabbix   18384 S    /opt/zabbix/sbin/zabbix_agentd: collector [idle 1 sec] 
 +  30273 zabbix   18384 S    /opt/zabbix/sbin/zabbix_agentd: active checks #1 [idle 1 sec] 
 + 
 +Ainsi que les logs 
 +  cat /tmp/zabbix_agentd.log 
 +  30271:20140901:112142.725 Starting Zabbix Agent [com-nas3]. Zabbix 2.2.5 (revision 47411). 
 +  30271:20140901:112142.725 using configuration file: /opt/zabbix/conf/zabbix_agentd.conf 
 +  30272:20140901:112142.726 agent #0 started [collector] 
 +  30273:20140901:112142.726 agent #1 started [active checks #1] 
 +  30273:20140901:112142.730 no active checks on server [172.16.30.84:10051]: host [com-nas3] not found 
 + 
 +Ici on voit l'hote "com-nas3" n'a pas été déclaré sur le serveur zabbix 
 + 
 + 
 +Pour que zabbix se lance au démarrage, j'ai créé le fichier suivant 
 +  vi /etc/init/zabbix.conf 
 + 
 +<code>description "Zabbix agent" 
 +author "Zabbix" 
 +start on runlevel 1 
 +stop on runlevel [06] 
 +respawn 
 +respawn limit 5 10 
 +console log 
 +expect fork 
 +pre-start script 
 +        date 
 +end script 
 +exec "/opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/conf/zabbix_agentd.conf" 
 +# vim:ft=upstart</code>
linux/zabbix.1404134637.txt.gz · Dernière modification : de edmc73