Skip to content
Geek is the Way!
Menu
  • Forums
  • Sobre o blog
  • Contato
  • English
Menu

Configuring Zabbix Agents on Linux servers

Posted on December 31, 2022December 30, 2024 by Thiago Crepaldi

Last Updated on December 30, 2024 by Thiago Crepaldi

From previous posts, we have deployed Zabbix Server on a Proxmox container. We also hardened the installation through Let’s Encrypt certificates for the web frontend and TLS encryption for the communication between Server and Agents/Proxies, after all, although encrypted Zabbix Server <-> Agent/Proxy communication with PSK or SSL certificates 🙂

In this post I will cover how to configure a Zabbix Agent on Debian/Ubuntu Linux containers running on Proxmox VE, which can be linked with Zabbix agents to collect metrics. I will limit the scope to the Agent creation and configuration and other posts will go through the process of configuring templates to monitor stuff, such as pfSense, Apache, MySQL, Postgres, Linux, FreeBSD, etc

The process is splitted in two parts. In the first we configure Zabbix Server frontend with the to-be-created agent host and next we configure the Zabbix Agent host itself so that it can connect to the Zabbix Server.

Configuring Zabbix Server through Web UI

Go to Configuration >> Hosts and click on Create Host button. When the configuration dialog open, the Host tab should be the default one. Fill in the following fields and leave the rest as-is:

  • Host
    • Host name: Type your hostname as returned by hostname command
    • Templates: leave empty
    • Host Groups: Linux Servers or Application or whatever describes your Agent
    • Interfaces:
      • Add a new interface
        • Type: Agent
        • IP Address: Type the server IP or leave empty
        • DNS Name: Type the server FQDN or leave it empty
        • Connect to: Select IP or DNS
        • Port: 10050
        • Description: Do your thing here
        • Monitored by Proxy: (no proxy)
      • Depending on you what you are going to monitor, you may also add a SNMP interface
  • Encryption
    • You can follow a previous post on how to use PSK or Let’s Encrypt Certificates, but in this post I will assume PSK
    • Connection to host: PSK
    • Connection from host: PSK
    • PSK Identity: myMachinePSK
    • PSK: f2ed8d2c19ab0f8af75f0285277f04f437aa6e34aafe50a9d5dc05e36364892e

Finish the host creation by clicking Update.

Configuring Zabbix Agent machine/VM/container

At this point, Zabbix server is trying to reach out to your Zabbix agent, but the Zabbix Agent is not even installed. Go to zabbix.com/download to get specifics for your Operating system, such as Debian, Ubuntu, SUSE, Rocky, etc The steps below are meant for Debian 11 (Bullseye) running Zabbix Agent 6.2:

Install Zabbix repository:

# wget https://repo.zabbix.com/zabbix/6.2/debian/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bdebian11_all.deb
# dpkg -i zabbix-release_6.2-4+debian11_all.deb
# apt update

Install Zabbix Agent 2:

# apt install zabbix-agent2 zabbix-agent2-plugin-*

Start Zabbix agent 2 process and make it start at system boot.

# systemctl restart zabbix-agent2
# systemctl enable zabbix-agent2

Now the agent software is up and running and the Zabbix server knows about its existence, but the agent doesn’t know anything about the server. Let’s edit the Zabbix Agent configuration file and point it to the Zabbix server:

# vim /etc/zabbix/zabbix_agent2.conf

Server=Type your Zabbix server IP or FQDN
ServerActive=Type your Zabbix server IP or FQDN
ListenPort=10050
Hostname=Agent hostname as returned by hostname command

By default, the server and agent communicate without encrypting data. Although this is acceptable in a LAN, I like to encrypt things just in case. You can select between my previous posts on using PSK or Let’s Encrypt Certificates to add specific encryption settings to /etc/zabbix/zabbix_agent2.conf.

Restart Zabbix agent for the settings to take effect

# systemctl restart zabbix-agent2

We are done and it is time to test the settings. Go to Configuration >> Hosts. In a couple minutes the agent you have create should be available. Look for the Availability and Agent encryption columns. When it is online, thy will be displayed in green colors. Now you are ready to start linking templates to your agent and monitor metrics

That is it, have fun!

Share this:

  • Tweet

Related

2 thoughts on “Configuring Zabbix Agents on Linux servers”

  1. Kevin Russell says:
    July 11, 2023 at 12:46 PM

    Thank you! Very well written instructions that likely saved me hours of time

    Reply
  2. Pingback: Monitoring Linux Server using Zabbix Agent - Geek is the Way!

Leave a ReplyCancel reply

LIKED? SUPPORT IT :)

Buy Me a Coffee


Search


Categories

  • Cooking (1)
  • Homelab (79)
    • APC UPS (6)
    • pfSense (40)
    • Proxmox (20)
    • Shopping (1)
    • Supermicro (2)
    • Synology NAS (8)
    • Ubiquiti (6)
    • UDM-Pro (4)
  • Random (3)
  • Wordpress (1)

Tags

Agentless monitoring (3) AP9631 (3) Apache2 (3) APC UPS (6) Bind9 (3) certificates (5) crontab (2) DDNS (5) debian (3) DNS (7) DSM (6) DuckDNS (2) Dynamic DNS (4) en_US (2) Firewall (9) gmail (3) LDAP (2) Let's Encrypt Certificates (7) monitoring (18) networking (21) PBS (3) pfsense (43) port forwarding (3) proxmox (17) proxmox backup server (3) proxmox virtual environment (16) pve (5) rev202207eng (76) security (28) SNMP (4) SNMPv1 (3) ssh (4) SSL (6) subnet (2) Synology (7) udm-pro (5) unifi (6) unifi controller (3) unifi switch (2) UPS (5) VLAN (4) vpn (9) wifi (4) Zabbix (18) Zabbix Agent2 (11)

See also

Privacy policy

Sitemap

©2025 Geek is the Way! | Design by Superb