tech:install_zabbix_sur_debian
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:install_zabbix_sur_debian [2025/11/14 08:44] – Jean-Baptiste | tech:install_zabbix_sur_debian [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Install Zabbix sur Debian | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install zabbix-server-mysql zabbix-frontend-php php5-fpm php5-mysqlnd | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [zabbix] | ||
| + | user = www-data | ||
| + | group = www-data | ||
| + | |||
| + | listen = / | ||
| + | listen.owner = www-data | ||
| + | listen.group = www-data | ||
| + | |||
| + | pm = dynamic | ||
| + | pm.max_children = 8 | ||
| + | pm.start_servers = 1 | ||
| + | pm.min_spare_servers = 1 | ||
| + | pm.max_spare_servers = 4 | ||
| + | php_value[post_max_size] = 16M | ||
| + | php_value[max_execution_time] = 300 | ||
| + | php_value[max_input_time] = 300 | ||
| + | php_value[open_basedir] = / | ||
| + | |||
| + | php_value[date.timezone] = " | ||
| + | ~~~ | ||
| + | |||
| + | Note : | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | WARNING: [pool zabbix] server reached pm.max_children setting (4), consider raising it | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~nginx | ||
| + | #server { | ||
| + | # server_name zabbix.acme.fr; | ||
| + | # return 301 https:// | ||
| + | #} | ||
| + | |||
| + | server { | ||
| + | #listen 443; | ||
| + | listen 80; | ||
| + | server_name zabbix.acme.fr; | ||
| + | access_log | ||
| + | error_log | ||
| + | #ssl on; | ||
| + | # | ||
| + | # | ||
| + | root / | ||
| + | index index.php index.html; | ||
| + | client_max_body_size 5m; | ||
| + | client_body_buffer_size 128k; | ||
| + | |||
| + | #location ~ /setup\.php { | ||
| + | # deny all; | ||
| + | #} | ||
| + | |||
| + | location ~ \.php$ { | ||
| + | fastcgi_pass unix:/ | ||
| + | include fastcgi_params; | ||
| + | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
| + | fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
| + | } | ||
| + | |||
| + | location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { | ||
| + | expires max; | ||
| + | log_not_found off; | ||
| + | } | ||
| + | |||
| + | location ~ /\.ht { | ||
| + | deny all; | ||
| + | } | ||
| + | |||
| + | location ~ /\. { | ||
| + | deny all; | ||
| + | } | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | ~~~sql | ||
| + | CREATE DATABASE zabbix; | ||
| + | CREATE USER ' | ||
| + | GRANT ALL PRIVILEGES ON zabbix.* TO " | ||
| + | FLUSH PRIVILEGES; | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | mysql -u zabbix -pzabbix -D zabbix < <(zcat / | ||
| + | mysql -u zabbix -pzabbix -D zabbix < <(zcat / | ||
| + | mysql -u zabbix -pzabbix -D zabbix < <(zcat / | ||
| + | ~~~ | ||
| + | |||
| + | Faire la suite de la config avec le navigateur | ||
| + | http:// | ||
| + | |||
| + | Télécharger le fichier zabbix.conf.php et placez-le dans / | ||
| + | |||
| + | `/ | ||
| + | ~~~php | ||
| + | <?php | ||
| + | // Zabbix GUI configuration file | ||
| + | global $DB; | ||
| + | |||
| + | $DB[' | ||
| + | $DB[' | ||
| + | $DB[' | ||
| + | $DB[' | ||
| + | $DB[' | ||
| + | $DB[' | ||
| + | |||
| + | // SCHEMA is relevant only for IBM_DB2 database | ||
| + | $DB[' | ||
| + | |||
| + | $ZBX_SERVER | ||
| + | $ZBX_SERVER_PORT = ' | ||
| + | $ZBX_SERVER_NAME = `; | ||
| + | |||
| + | $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; | ||
| + | ?> | ||
| + | ~~~ | ||
| + | |||
| + | Bloquer l' | ||
| + | |||
| + | Identifiant à la 1er connexion :\\ | ||
| + | Utilisateur : **Admin**\\ | ||
| + | MDP : **zabbix** | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | DBHost=localhost | ||
| + | DBName=zabbix | ||
| + | DBUser=zabbix | ||
| + | DBPassword=zabbix | ||
| + | DBPort=3306 | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | START=yes | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | service zabbix-server restart | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Config Agent | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | Server=127.0.0.1, | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | service zabbix-agent restart | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Zabbix Proxy | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install zabbix-proxy-mysql | ||
| + | |||
| + | mysql -u zabbix -pzabbix -D zabbix | ||
| + | ~~~ | ||
| + | FIXME Creation DB | ||
| + | |||
| + | ~~~bash | ||
| + | mysql -u zabbix -pzabbix -D zabbix < <(zcat / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | FIXME conf DB | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | START=yes | ||
| + | ~~~ | ||
| + | |||
| + | Count proxy_history | ||
| + | ~~~bash | ||
| + | watch -n 1 'echo " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Exemple de conf | ||
| + | |||
| + | ### Sur le serveur Zabbix | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | DBHost=localhost | ||
| + | DBName=zabbix | ||
| + | DBUser=zabbix | ||
| + | DBPassword=zabbix | ||
| + | DBPort=3306 | ||
| + | AlertScriptsPath=/ | ||
| + | |||
| + | # Nb of Zabbix Proxy | ||
| + | StartProxyPollers=1 | ||
| + | |||
| + | ProxyConfigFrequency=300 | ||
| + | ProxyDataFrequency=120 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Sur le Proxy Zabbix (mode passif) | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | ProxyMode=1 | ||
| + | |||
| + | # Nom doit être identique dans Zabbix. Pas forcement un nom DNS | ||
| + | Hostname=Proxy Cigne1 | ||
| + | |||
| + | DBHost=localhost | ||
| + | DBName=zabbix | ||
| + | DBUser=zabbix | ||
| + | DBPassword=zabbix | ||
| + | DBPort=3306 | ||
| + | |||
| + | # Garde jusqu' | ||
| + | ProxyOfflineBuffer=24 | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | Server=127.0.0.1, | ||
| + | Include=/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### L' | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | Server=10.0.10.4 | ||
| + | Hostname=node1-01 | ||
| + | Include=/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Forcer le prise de compte de changement de configuration | ||
| + | |||
| + | Sur le serveur Zabbix | ||
| + | ~~~bash | ||
| + | zabbix_server -R config_cache_reload | ||
| + | ~~~ | ||
| + | |||
| + | Sur les proxys Zabbix | ||
| + | ~~~bash | ||
| + | zabbix_proxy -R config_cache_reload | ||
| + | ~~~ | ||
| + | |||
| + | Note : Commencer par le serveur Zabbix | ||
| + | |||
