MDstable
NoteSnippetChecklistPlaybook

Zabbix — Supervision IT Infrastructure

Déploiement et configuration de Zabbix : monitoring serveurs/réseau, templates, triggers d'alerte, intégration NOC

snippetintermediate 2026-06-19 5 min read
zabbixmonitoringsnmpnocalertinginfrasupervision

Présentation

Zabbix est une plateforme de supervision IT open source qui monitore :

  • Serveurs : CPU, RAM, disque, processus (agent Zabbix)
  • Réseau : interfaces, bande passante, disponibilité (SNMP, ICMP)
  • Services : HTTP, SSH, bases de données, ports
  • Applications : métriques custom via trapper ou API

Déploiement Docker

yaml
# docker-compose.yml
version: '3'
services:
zabbix-server:
image: zabbix/zabbix-server-pgsql:ubuntu-6.4-latest
ports:
- "10051:10051"
environment:
- DB_SERVER_HOST=postgres
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pass
- POSTGRES_DB=zabbixdb
depends_on:
- postgres
zabbix-web:
image: zabbix/zabbix-web-nginx-pgsql:ubuntu-6.4-latest
ports:
- "8080:8080"
environment:
- DB_SERVER_HOST=postgres
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pass
- POSTGRES_DB=zabbixdb
- ZBX_SERVER_HOST=zabbix-server
- PHP_TZ=Europe/Paris
depends_on:
- zabbix-server
postgres:
image: postgres:15
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pass
- POSTGRES_DB=zabbixdb
volumes:
- pgdata:/var/lib/postgresql/data
# Agent sur le serveur Zabbix lui-même
zabbix-agent:
image: zabbix/zabbix-agent2:ubuntu-6.4-latest
environment:
- ZBX_HOSTNAME=zabbix-server
- ZBX_SERVER_HOST=zabbix-server
volumes:
pgdata:
# Accès : http://localhost:8080
# Login : Admin / zabbix (changer immédiatement)

Agent Zabbix — Installation

bash
# Ubuntu/Debian — Agent 2 (recommandé)
wget https//repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1ubuntu22deb
dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
apt update && apt install -y zabbix-agent2
# Configuration /etc/zabbix/zabbix_agent2.conf
Server1921681100 # IP serveur Zabbix
ServerActive1921681100
Hostnamemon-serveur # Nom de l'hôte (doit correspondre dans Zabbix)
LogFile/var/log/zabbix/zabbix_agent2.log
systemctl enable --now zabbix-agent2
# Windows — PowerShell
# Télécharger zabbix_agent2 MSI depuis zabbix.com
msiexec /i zabbix_agent2msi /lv installlog
LISTENPORT10050 SERVER1921681100 HOSTNAMEpc-windows
# Vérification connectivité depuis le serveur
zabbix_get -s 192168150 -p 10050 -k systemuptime

Templates — Configuration rapide

# Templates officiels à utiliser (Configuration > Hosts > Templates)
Linux by Zabbix agent CPU RAM disque rseau processus
Windows by Zabbix agent WMI services event log
Network devices by SNMP Switches routeurs
Apache by Zabbix agent Mtriques Apache
Nginx by Zabbix agent Connexions requtes/s
PostgreSQL by Zabbix agent Sessions locks replication
Docker by Zabbix agent Conteneurs CPU/RAM

Ajouter un hôte

Configuration > Hosts > Create host
Host name mon-serveur
Groups Linux servers
Interfaces Agent IP 192168150 Port 10050
Templates Linux by Zabbix agent
Monitoring > Hosts > Vrifier "ZBX" vert agent OK

Triggers — Alertes

Triggers clés à configurer

# CPU élevé
mon-serveur:system.cpu.util[,idle].avg(5m)} < 20
# RAM faible
mon-serveur:vm.memory.size[pavailable].last()} < 10
# Disque plein
mon-serveur:vfs.fs.size[/,pfree].last()} < 10
# Host inaccessible
mon-serveur:agent.ping.nodata(3m)} 1
# Processus arrêté
mon-serveur:proc.num[nginx].last()} 0
# Port fermé
mon-serveur:net.tcp.port[,443].last()} 0

Sévérités

| Niveau | Couleur | Usage | |--------|---------|-------| | Disaster | Rouge foncé | Service critique DOWN | | High | Rouge | Impact service important | | Average | Orange | Anomalie significative | | Warning | Jaune | Seuil approché | | Information | Bleu | Info non critique | | Not classified | Gris | À catégoriser |


Alertes — Notifications

bash
# Configuration Media Types
Administration > Media types > Email
# SMTP
SMTP server smtpgmailcom
SMTP port 587
SMTP helo gmailcom
From zabbixcompanycom
Security STARTTLS
Username Password credentials
# Webhook Slack
Administration > Media types > Slack
WEBHOOK_URL https//hooks.slack.com/services/XXX
Message template
"🔴 {TRIGGER.SEVERITY} — {HOST.NAME}\n{TRIGGER.NAME}\n{ITEM.VALUE}"
# Configuration User media
Administration > Users > Admin > Media
Type Email ou Slack
Send to email ou channel
Severity cocher les niveaux notifier

Supervision réseau (SNMP)

bash
# Activer SNMP sur switch/routeur
# Cisco IOS
snmp-server community public RO
snmp-server community private RW
# Zabbix — Ajouter hôte SNMP
Configuration > Hosts > Create host
Interface SNMP IP switch Port 161
Templates Network Generic Device by SNMP
# Test SNMP depuis Zabbix
snmpwalk -v2c -c public 19216811 136121110
# Doit retourner la description du device

Dashboards NOC

# Dashboard recommandé pour NOC
Monitoring > Dashboard > Create
Widgets
Map topologie rseau avec statuts
Problems liste des problmes actifs
Graph CPU/RAM des serveurs critiques
Clock horloge
Host availability htes UP/DOWN
Top 10 hosts plus chargs
# Vue plein écran (mode NOC)
Monitoring > Dashboard Kiosk mode icne plein cran

Intégration Grafana

yaml
# Plugin Zabbix dans Grafana
Administration > Plugins > Zabbix
# Datasource
Configuration > Data Sources > Add > Zabbix
URL : http://zabbix-web:8080/api_jsonrpc.php
Username : Admin
Password : zabbix
Trends : enabled (pour données historiques > 1h)
# Dashboard populaire
# Grafana.com → Dashboard ID 13571 (Zabbix Server Health)
# Dashboard ID 9338 (Zabbix — Linux Overview)

API Zabbix

python
import requests
url = "http://localhost:8080/api_jsonrpc.php"
def zabbix_call(method, params, auth=None):
payload = {
"jsonrpc": "2.0",
"method": method,
"params": params,
"id": 1,
}
if auth:
payload["auth"] = auth
r = requests.post(url, json=payload)
return r.json()["result"]
# Login
token = zabbix_call("user.login", {"username": "Admin", "password": "zabbix"})
# Lister hôtes avec problèmes
hosts = zabbix_call("host.get", {
"output": ["hostid", "host", "status"],
"filter": {"status": 0}
}, auth=token)
# Lister les triggers actifs
problems = zabbix_call("problem.get", {
"output": "extend",
"selectHosts": ["host"],
"recent": True,
"severities": [3, 4, 5] # Average, High, Disaster
}, auth=token)
OPS·BRAIN v1.08 notes · Monitoringlocal