Tutorials

Hands-on guides and configuration examples.

Configuration library · scripts and downloads ↗

Monitor the network with Zabbix on Debian 13

Zabbix can check router availability and collect switch traffic and interface status.

The Compose file installs Zabbix 7.0 LTS and PostgreSQL on a Debian 13 VM. If you already run Zabbix, start with adding the router.

You will test ICMP, configure read-only SNMPv3 and trigger an alert on a test device.

  1. Prepare the folder and PostgreSQL secret

    Install Docker and Compose on Debian 13. Create the project folder and generate a database password in a private .env file. The snippet preserves any existing file.

    Terminal
    sudo apt install openssl
    mkdir -p ~/zabbix-network && cd ~/zabbix-network &&
    (umask 077; set -o noclobber; secret=$(openssl rand -hex 32) &&
     printf 'ZABBIX_DB_PASSWORD=%s\n' "$secret" > .env)
  2. Install Zabbix and PostgreSQL

    Save this block to compose.yaml. If port 8084 is in use, change it in Compose and the tunnel destination. The zabbix-db volume persists the database.

    compose.yaml
    x-database: &database
      POSTGRES_DB: zabbix
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: "${ZABBIX_DB_PASSWORD:?Set ZABBIX_DB_PASSWORD in .env}"
    
    services:
      postgres:
        image: postgres:16-alpine
        restart: unless-stopped
        environment: *database
        volumes:
          - zabbix-db:/var/lib/postgresql/data
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U zabbix -d zabbix"]
          interval: 5s
          timeout: 3s
          retries: 20
    
      zabbix-server:
        image: zabbix/zabbix-server-pgsql:alpine-7.0-latest
        restart: unless-stopped
        depends_on:
          postgres:
            condition: service_healthy
        environment:
          <<: *database
          DB_SERVER_HOST: postgres
    
      zabbix-web:
        image: zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
        restart: unless-stopped
        depends_on:
          - zabbix-server
        environment:
          <<: *database
          DB_SERVER_HOST: postgres
          ZBX_SERVER_HOST: zabbix-server
          PHP_TZ: Europe/Paris
        ports:
          - "127.0.0.1:8084:8080"
    
    volumes:
      zabbix-db:

    The PostgreSQL port stays on the Docker network. Zabbix sends the ICMP and SNMP polls to devices without publishing a port for these checks.

  3. Start and open the interface

    Run the first three commands on the VM. Wait for database initialization, then run the tunnel on your client with your VM address and SSH username. Open http://127.0.0.1:8084.

    Terminal
    sudo docker compose config --quiet && sudo docker compose up -d
    sudo docker compose ps
    sudo docker compose logs --tail=60 zabbix-server
    
    ssh -N -L 127.0.0.1:8084:127.0.0.1:8084 utilisateur@IP_DE_LA_VM

    On a fresh install, sign in with Admin and zabbix. Change the Admin password immediately and keep the interface on loopback. Use Docker Engine 28 or later for this local port mapping.

  4. Check router availability with ICMP

    Allow ICMP from the monitoring VM to the device. Replace 192.168.10.1 with its IP and test from the Zabbix container.

    • In Data collection → Hosts, create Router-LAN, select or create the Network devices group and add an Agent interface with the router IP to give the ICMP Ping template a target. The device does not need an installed agent for these ICMP checks.
    • Link the ICMP Ping template. In Monitoring → Latest data, check availability, packet loss and latency. If the test fails, check routing and inter-VLAN rules first.
    Terminal
    sudo docker compose exec zabbix-server fping -c 3 192.168.10.1
  5. Monitor a switch with SNMPv3

    Enable a read-only SNMPv3 user on the switch. Allow UDP 161 to the switch from the Zabbix VM or the source address seen by the switch. Use authPriv with SHA-256 and AES when supported, with distinct passphrases.

    • Create Switch-LAN in Zabbix and add an SNMP interface with the management IP and port 161. Select SNMPv3 and authPriv, then enter the switch security name, protocols and both passphrases.
    • Link the included template for your switch vendor and model. If none matches, try Network Generic Device by SNMP shipped with your Zabbix version. If the template already inherits ICMP Ping, keep the inherited link.
    • In Latest data, check the switch name or uptime, then wait for interface discovery to show inbound and outbound traffic and link state. If only pings appear, check UDP 161, credentials and SNMPv3 algorithms.
  6. Verify alerts and recovery

    Monitor a test device or VM with ICMP Ping. Disconnect its network until the trigger enters problem state, then reconnect it and check recovery in Monitoring → Problems.

    • To receive email alerts, configure the media type, add the address to the recipient account and create a trigger action limited to the test group. Configure a recovery operation too and check receipt of both messages.
    • Before updating, store compose.yaml, .env and a PostgreSQL dump in a private location. Use the guide below to visualize metrics in Grafana.
    Backup
    (umask 077; set -o noclobber; sudo docker compose exec -T postgres pg_dump -U zabbix -Fc zabbix > "zabbix-$(date +%F-%H%M%S).dump")
Zabbix 7.0 container documentation ↗