zabbixmonitoringsnmp
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.ymlversion: '3'services:zabbix-server:image: zabbix/zabbix-server-pgsql:ubuntu-6.4-latestports:- "10051:10051"environment:- DB_SERVER_HOST=postgres- POSTGRES_USER=zabbix- POSTGRES_PASSWORD=zabbix_pass- POSTGRES_DB=zabbixdbdepends_on:- postgreszabbix-web:image: zabbix/zabbix-web-nginx-pgsql:ubuntu-6.4-latestports:- "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/Parisdepends_on:- zabbix-serverpostgres:image: postgres:15environment:- POSTGRES_USER=zabbix- POSTGRES_PASSWORD=zabbix_pass- POSTGRES_DB=zabbixdbvolumes:- pgdata:/var/lib/postgresql/data# Agent sur le serveur Zabbix lui-mêmezabbix-agent:image: zabbix/zabbix-agent2:ubuntu-6.4-latestenvironment:- ZBX_HOSTNAME=zabbix-server- ZBX_SERVER_HOST=zabbix-servervolumes: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-1ubuntu22debdpkg -i zabbix-release_6.4-1+ubuntu22.04_all.debapt update && apt install -y zabbix-agent2# Configuration /etc/zabbix/zabbix_agent2.confServer1921681100 # IP serveur ZabbixServerActive1921681100Hostnamemon-serveur # Nom de l'hôte (doit correspondre dans Zabbix)LogFile/var/log/zabbix/zabbix_agent2.logsystemctl enable --now zabbix-agent2# Windows — PowerShell# Télécharger zabbix_agent2 MSI depuis zabbix.commsiexec /i zabbix_agent2msi /lv installlogLISTENPORT10050 SERVER1921681100 HOSTNAMEpc-windows# Vérification connectivité depuis le serveurzabbix_get -s 192168150 -p 10050 -k systemuptime
Templates — Configuration rapide
# Templates officiels à utiliser (Configuration > Hosts > Templates)Linux by Zabbix agent CPU RAM disque rseau processusWindows by Zabbix agent WMI services event logNetwork devices by SNMP Switches routeursApache by Zabbix agent Mtriques ApacheNginx by Zabbix agent Connexions requtes/sPostgreSQL by Zabbix agent Sessions locks replicationDocker by Zabbix agent Conteneurs CPU/RAM
Ajouter un hôte
Configuration > Hosts > Create hostHost name mon-serveurGroups Linux serversInterfaces Agent IP 192168150 Port 10050Templates Linux by Zabbix agentMonitoring > Hosts > Vrifier "ZBX" vert agent OK
Triggers — Alertes
Triggers clés à configurer
# CPU élevémon-serveur:system.cpu.util[,idle].avg(5m)} < 20# RAM faiblemon-serveur:vm.memory.size[pavailable].last()} < 10# Disque pleinmon-serveur:vfs.fs.size[/,pfree].last()} < 10# Host inaccessiblemon-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 TypesAdministration > Media types > Email# SMTPSMTP server smtpgmailcomSMTP port 587SMTP helo gmailcomFrom zabbixcompanycomSecurity STARTTLSUsername Password credentials# Webhook SlackAdministration > Media types > SlackWEBHOOK_URL https//hooks.slack.com/services/XXXMessage template"🔴 {TRIGGER.SEVERITY} — {HOST.NAME}\n{TRIGGER.NAME}\n{ITEM.VALUE}"# Configuration User mediaAdministration > Users > Admin > MediaType Email ou SlackSend to email ou channelSeverity cocher les niveaux notifier
Supervision réseau (SNMP)
bash
# Activer SNMP sur switch/routeur# Cisco IOSsnmp-server community public ROsnmp-server community private RW# Zabbix — Ajouter hôte SNMPConfiguration > Hosts > Create hostInterface SNMP IP switch Port 161Templates Network Generic Device by SNMP# Test SNMP depuis Zabbixsnmpwalk -v2c -c public 19216811 136121110# Doit retourner la description du device
Dashboards NOC
# Dashboard recommandé pour NOCMonitoring > Dashboard > CreateWidgetsMap topologie rseau avec statutsProblems liste des problmes actifsGraph CPU/RAM des serveurs critiquesClock horlogeHost availability htes UP/DOWNTop 10 hosts plus chargs# Vue plein écran (mode NOC)Monitoring > Dashboard Kiosk mode icne plein cran
Intégration Grafana
yaml
# Plugin Zabbix dans GrafanaAdministration > Plugins > Zabbix# DatasourceConfiguration > Data Sources > Add > ZabbixURL : http://zabbix-web:8080/api_jsonrpc.phpUsername : AdminPassword : zabbixTrends : 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 requestsurl = "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"] = authr = requests.post(url, json=payload)return r.json()["result"]# Logintoken = zabbix_call("user.login", {"username": "Admin", "password": "zabbix"})# Lister hôtes avec problèmeshosts = zabbix_call("host.get", {"output": ["hostid", "host", "status"],"filter": {"status": 0}}, auth=token)# Lister les triggers actifsproblems = 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