Zabbix is a software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail-based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualization features based on the stored data. This makes Zabbix ideal for capacity planning. In this step by step guide I will show you how to install Zabbix on your Synology NAS using Docker & Portainer.
Zabbix v7.0.5 release.
This guide works perfectly with the latestSTEP 1
Please Support My work by Making a Donation.
STEP 2
Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.
STEP 3
Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.
STEP 4
Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.
STEP 5
Now click the “Create” button. Follow the instructions in the image below.
STEP 6
After you click the Create button, the window below will open. Follow the instructions in the image below.
On the General area, set the Reverse Proxy Name description: type in Zabbix. After that, add the following instructions:
Source:
Protocol: HTTPS
Hostname: zabbix.yourname.synology.me
Port: 443
Check Enable HSTS
Destination:
Protocol: HTTP
Hostname: localhost
Port: 8532
STEP 7
On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.
STEP 8
Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.
STEP 9
Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.
STEP 10
Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it zabbix. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.
STEP 11
Now create thirteen new folders inside the zabbix folder that you created at STEP 10 and name them alerts, db, dbscripts, enc, export, external, keys, mibs, modules, nginx, server, sharemodules, snmp. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.
STEP 12
Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.
STEP 13
In the Name field type in zabbix. Follow the instructions in the image below.
version: '3.9' services: postgres: image: postgres:16 container_name: Zabbix-DB volumes: - /volume1/docker/zabbix/db:/var/lib/postgresql/data:rw environment: POSTGRES_DB: zabbix POSTGRES_USER: zabbixuser POSTGRES_PASSWORD: zabbixpass healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "zabbix", "-U", "zabbixuser" ] interval: 10s timeout: 5s retries: 3 start_period: 60s restart: on-failure:5 zabbix-server: image: zabbix/zabbix-server-pgsql container_name: Zabbix-SERVER ports: - 10051:10051 environment: DB_SERVER_HOST: postgres DB_SERVER_PORT: 5432 POSTGRES_DB: zabbix POSTGRES_USER: zabbixuser POSTGRES_PASSWORD: zabbixpass volumes: - /volume1/docker/zabbix/server:/var/lib/zabbix/export:rw - /volume1/docker/zabbix/snmp:/var/lib/zabbix/snmptraps:rw - /volume1/docker/zabbix/alerts:/usr/lib/zabbix/alertscripts:ro - /volume1/docker/zabbix/external:/usr/lib/zabbix/externalscripts:ro - /volume1/docker/zabbix/dbscripts:/var/lib/zabbix/dbscripts:ro - /volume1/docker/zabbix/export:/var/lib/zabbix/export:rw - /volume1/docker/zabbix/modules:/var/lib/zabbix/modules:ro - /volume1/docker/zabbix/enc:/var/lib/zabbix/enc:ro - /volume1/docker/zabbix/keys:/var/lib/zabbix/ssh_keys:ro - /volume1/docker/zabbix/mibs:/var/lib/zabbix/mibs:ro healthcheck: test: grep -qr "zabbix_server" /proc/*/status || exit 1 interval: 10s timeout: 5s retries: 3 start_period: 90s restart: on-failure:5 depends_on: postgres: condition: service_healthy zabbix-agent: image: zabbix/zabbix-agent:latest container_name: Zabbix-Agent restart: on-failure:5 depends_on: - zabbix-server ports: - 10050:10050 environment: ZBX_HOSTNAME: "zabbix_server" ZBX_SERVER_HOST: zabbix-server ZBX_SERVER_PORT: '10051' ZBX_SERVER_ACTIVE: zabbix-server zabbix-dashboard: image: zabbix/zabbix-web-nginx-pgsql container_name: Zabbix-WEB environment: DB_SERVER_HOST: postgres DB_SERVER_PORT: 5432 POSTGRES_DB: zabbix POSTGRES_USER: zabbixuser POSTGRES_PASSWORD: zabbixpass ZBX_SERVER_HOST: zabbix-server PHP_TZ: Europe/Bucharest ZABBIX_DASHBOARD_HOSTNAME: zabbix.yourname.synology.me volumes: - /volume1/docker/zabbix/sharemodules:/usr/share/zabbix/modules/:ro - /volume1/docker/zabbix/nginx:/etc/ssl/nginx:ro ports: - 8532:8080 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/"] interval: 10s timeout: 5s retries: 3 start_period: 90s restart: on-failure:5
Note: Before you paste the code above in the Web editor area below, change the value for PHP_TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value for ZABBIX_DASHBOARD_HOSTNAME and type in your own synology.me DDNS without https:// at the beginning that you have previously created at STEP 6.
STEP 14
Scroll down on the page until you see a button called Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.
STEP 15
If everything goes right, you will see this message at the top right of your screen: “Success Stack successfully deployed“.
STEP 16
Go back to STEP 1 or you will deal with karma 🙂.
STEP 17
Please wait approximately 2-3 minutes for the installation to be completed or you will get a Database error page if you try to connect too soon. Now open your browser and type in your HTTPS/SSL certificate like this https://zabbix.yourname.synology.me In my case it’s https://zabbix.mariushosting.synology.me If everything goes right, you will see the Zabbix Login Page. Type in the default Username and Password then click Login. Follow the instructions in the image below.
STEP 18
On the left sidebar click User settings then Profile. Follow the instructions in the image below.
STEP 19
Change the default zabbix Password and Theme. Click Update. Follow the instructions in the image below.
STEP 20
Log into Zabbix with your new password that you have previously created at STEP 19.
STEP 21
On the left Zabbix sidebar, click Hosts then right click on the Zabbix server then Host. Follow the instructions in the image below.
STEP 22
Type in your own Zabbix Agent IP address, then click Update. You will find this IP address in the second screenshot below. Follow the instructions in the images below.
Identify your Zabbix Agent IP address. Open Portainer, then click Containers. Identify your Zabbix-Agent IP Address then copy it. Paste the Zabbix-Agent IP Address in the Agent interface in the screenshot above.
STEP 23
Refresh the Zabbix Hosts page. You will now see your Zabbix server online.
STEP 24
Zabbix Server will appear on the host area.
STEP 25
Your Zabbix dashboard at a glance!
STEP 26
To add your NAS as a host in Zabbix, you need to create new host in Zabbix then activate SNMP on your NAS in Control Panel / Terminal & SNMP / SNMPv3. From the Zabbix website download the yaml file then check the instructions for Synology Integration snmpv3/6.0
Enjoy Zabbix!
If you encounter issues by using this container, make sure to check out the Common Docker issues article.
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find out how to update the Zabbix container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.
This post was updated on Wednesday / October 23rd, 2024 at 8:20 PM