Author | Nejat Hakan |
nejat.hakan@outlook.de | |
PayPal Me | https://paypal.me/nejathakan |
Network/Server Monitoring Zabbix
Introduction to Zabbix
Welcome to the comprehensive guide on Network/Server Monitoring with Zabbix. In the realm of IT infrastructure management, ensuring the continuous availability and optimal performance of servers, applications, and network devices is paramount. Zabbix stands out as a powerful, open-source, enterprise-level monitoring solution designed to track the status of various IT components, including networks, servers, virtual machines, and cloud services. This introduction will lay the groundwork for understanding what Zabbix is, why it's an excellent choice for self-hosting, its core components, and its overall architecture. By the end of this section, you will have a solid conceptual understanding of Zabbix, preparing you for the practical, hands-on sections that follow.
What is Zabbix?
Zabbix is an all-in-one monitoring solution that allows users to collect, store, manage, and analyze data from various IT infrastructure components. It was created by Alexei Vladishev and is now developed and supported by Zabbix SIA. It's designed to be highly scalable, capable of monitoring tens of thousands of devices, from small environments with a few servers to large enterprises with complex, distributed infrastructures.
At its core, Zabbix gathers various types of data, such as CPU load, memory usage, network traffic, disk space, application status, and much more. This data is then processed, and Zabbix can trigger alerts or notifications if predefined thresholds are breached or if anomalies are detected. It provides a web-based interface for visualizing data through graphs, dashboards, and maps, making it easier for administrators to gain insights into their system's health and performance.
Key characteristics of Zabbix include:
- Open Source: Zabbix is released under the GNU General Public License (GPL) version 2, meaning it's free to use, distribute, and modify. This significantly lowers the total cost of ownership compared to proprietary monitoring solutions.
- Versatility: It can monitor a wide array of devices and applications, including operating systems (Linux, Windows, macOS, BSD), network equipment (routers, switches), Java applications, web services, databases, and more.
- Scalability: Zabbix architecture, particularly with the use of Zabbix proxies, allows it to scale from small setups to monitoring thousands of devices across geographically distributed locations.
- Flexibility: It supports various data collection methods, including agent-based monitoring, agentless monitoring (e.g., SNMP, IPMI, JMX, SSH/Telnet checks), and custom scripting.
- Automation: Zabbix features powerful automation capabilities, such as auto-discovery of hosts and services, automated problem remediation, and integration with configuration management tools.
Why Zabbix for Self-Hosting?
Self-hosting Zabbix means you deploy and manage the Zabbix server and its components on your own infrastructure, whether it's on-premises hardware, private cloud, or virtual machines you control. This approach offers several advantages, particularly for individuals and organizations that prioritize control, customization, and data privacy:
- Complete Control: You have full control over the Zabbix installation, configuration, and data. This allows for deep customization to meet specific monitoring requirements that might not be possible with a SaaS (Software as a Service) monitoring solution.
- Data Privacy and Security: Monitoring data, which can be sensitive, remains within your own network boundaries. This is crucial for organizations with strict data governance policies or those operating in regulated industries.
- Cost-Effectiveness: Being open-source, Zabbix has no licensing fees. The primary costs are associated with the hardware to run it and the time invested in setting it up and maintaining it. For many, this is significantly more cost-effective than commercial alternatives, especially at scale.
- Customization and Integration: You can integrate Zabbix with other internal systems, extend its functionality with custom scripts, or even modify its source code if needed. This level of flexibility is often a key driver for self-hosting.
- Learning and Skill Development: Self-hosting Zabbix provides an excellent opportunity to learn about enterprise monitoring, system administration, database management, and network protocols in a practical, hands-on way. This is particularly valuable for students and IT professionals looking to enhance their skill set.
- No Vendor Lock-in: You are not tied to a specific vendor's ecosystem or pricing model. You have the freedom to adapt and evolve your monitoring strategy as your needs change.
While self-hosting offers these benefits, it also comes with the responsibility of managing the underlying infrastructure, ensuring Zabbix server uptime, performing backups, and handling updates. This guide aims to equip you with the knowledge to confidently manage your self-hosted Zabbix instance.
Key Features and Components
Zabbix is not a single application but rather a suite of components that work together to provide a comprehensive monitoring solution. Understanding these components is crucial for effective deployment and management.
-
Zabbix Server: This is the core component of Zabbix. The Zabbix server is responsible for polling and trapping data, calculating triggers, sending notifications to users, and acting as a central repository of all configuration, statistical, and operational data. It performs the actual monitoring, data processing, and alerting logic. It can be run on various Linux distributions, and it requires a database to store its data.
-
Zabbix Agent: The Zabbix agent is a small piece of software deployed on the monitored targets (hosts). Its purpose is to actively collect local resource and application data (hard drive, memory, processor statistics, etc.) and report this data to the Zabbix server. Zabbix agents are available for most operating systems, including Linux, Windows, macOS, and various UNIX-like systems. Agents can perform both passive checks (server requests data, agent responds) and active checks (agent periodically sends data to the server).
-
Zabbix Proxy: A Zabbix proxy is an optional component that can collect performance and availability data on behalf of a Zabbix server. It is particularly useful for distributed monitoring across different network segments, remote locations, or demilitarized zones (DMZs). The proxy gathers data locally from agents and then forwards it to the main Zabbix server, thus reducing the load on the server and simplifying the management of distributed environments. Proxies can also buffer data locally if the connection to the main server is temporarily lost.
-
Zabbix Web Interface (Frontend): The Zabbix web interface, typically written in PHP, provides a graphical user interface for managing and viewing monitoring data. Through the frontend, administrators can configure monitored hosts, define items and triggers, create graphs and dashboards, manage users, and view alerts and reports. It's the primary way users interact with Zabbix.
-
Database: Zabbix requires a database to store all its configuration data (like host information, items, triggers) and the historical monitoring data collected from the monitored systems. Zabbix supports several popular relational database management systems (RDBMS):
- MySQL / MariaDB
- PostgreSQL
- Oracle
- SQLite (primarily for Zabbix proxy, not recommended for Zabbix server in production)
- TimescaleDB (a time-series database extension for PostgreSQL, highly recommended for large Zabbix setups)
The choice of database can significantly impact Zabbix's performance and scalability.
Zabbix Architecture Overview
The Zabbix architecture is designed to be flexible and scalable. Here's a simplified overview of how the components interact:
-
Data Collection:
- Agent-based: Zabbix agents on monitored hosts collect data and send it to the Zabbix server or proxy.
- Agentless: The Zabbix server or proxy can directly query devices using standard protocols like SNMP (for network devices), IPMI (for hardware monitoring), JMX (for Java applications), or run SSH/Telnet commands.
- External Scripts: Custom scripts can be executed by the Zabbix server, proxy, or agent to gather specific data not covered by standard methods.
-
Data Transmission:
- Data collected by agents or proxies is sent to the Zabbix server. Communication between components is typically over TCP.
- Proxies act as intermediaries, collecting data from agents in their designated area and then forwarding a consolidated stream of data to the Zabbix server. This reduces the number of direct connections to the Zabbix server and can simplify firewall configurations.
-
Data Processing and Storage:
- The Zabbix server receives the data and stores it in the configured backend database.
- It processes the incoming data against defined triggers. A trigger is a logical expression that defines a problem threshold (e.g., "CPU load is too high for 5 minutes").
-
Alerting and Notification:
- If a trigger condition is met (i.e., a problem is detected), the Zabbix server generates an event.
- Based on configured actions, Zabbix can then send notifications to users via various channels (email, SMS, Slack, PagerDuty, etc.) or execute pre-defined remediation scripts.
-
Visualization and Management:
- Users interact with Zabbix through the web interface. They can configure monitoring parameters, view collected data in graphs and dashboards, acknowledge problems, and manage the overall Zabbix environment.
This modular architecture allows Zabbix to adapt to various network topologies and monitoring requirements, from simple single-server setups to complex, geographically dispersed enterprise environments.
Workshop Getting Acquainted with Zabbix Concepts
This workshop is purely conceptual and designed to solidify your understanding of the terms and components discussed. There are no practical steps to execute on a computer yet.
Objective: To map Zabbix components and concepts to a familiar real-world scenario.
Scenario:
Imagine you are managing the IT infrastructure for a small university department. This department has:
- A main office with a server room.
- A remote research lab connected via a VPN.
- Several faculty computers (mix of Windows and Linux).
- A public-facing website hosted on a dedicated server.
- A network switch and a firewall.
Task:
For each of the Zabbix components and concepts listed below, describe how it would apply to monitoring the university department's IT infrastructure.
-
Zabbix Server:
- Where would you ideally install it? Why? What would be its main responsibilities in this scenario?
- Example Thought Process: The Zabbix Server would likely be installed on a dedicated virtual machine or physical server within the main office's server room for good connectivity and physical security. Its responsibilities would be to orchestrate all monitoring: poll faculty computers, the web server, network devices; receive data from the remote lab (perhaps via a proxy); store all collected metrics like CPU usage, website response time, network traffic; evaluate triggers (e.g., if the website is down); and send alerts to the IT admin.
-
Database:
- What kind of information would this database store for the department's infrastructure? Why is it important?
- Example Thought Process: The database (e.g., PostgreSQL) would store configuration details for all monitored devices (faculty PCs, servers, switch), what metrics (items) are being collected for each (e.g.,
system.cpu.load
for servers,net.if.in
for the switch), the thresholds (triggers) that define problems (e.g., disk space below 10% on the web server), and all the historical data points collected over time. This historical data is crucial for trend analysis, capacity planning, and troubleshooting past incidents.
-
Zabbix Agent:
- On which devices in the department would you install a Zabbix Agent? What kind of specific data would these agents collect from, for example, a faculty Linux computer versus the web server?
- Example Thought Process: Zabbix Agents would be installed on all faculty computers (Windows and Linux) and the dedicated web server.
- On a faculty Linux computer, the agent would collect: CPU load, memory usage, disk space, running processes, network interface statistics, and perhaps specific application logs if needed.
- On the web server, besides the standard OS metrics, the agent might be configured to collect more specific data like web server (e.g., Apache/Nginx) active connections, request rates, error rates, and the status of the web application process.
-
Zabbix Proxy:
- Would a Zabbix Proxy be beneficial for the remote research lab? Why or why not? If yes, what would be its role?
- Example Thought Process: Yes, a Zabbix Proxy would be highly beneficial for the remote research lab. It would be installed on a machine within the lab. Its role would be to collect data from any monitored devices (e.g., lab workstations, specialized equipment if it supports agent installation or SNMP) within the lab's network. The proxy would then send this data in a consolidated manner to the main Zabbix Server in the main office over the VPN. This reduces VPN traffic, offloads the main server, and allows monitoring to continue in the lab even if the VPN connection to the main office is temporarily down (the proxy buffers data).
-
Zabbix Web Interface (Frontend):
- Who would use the Zabbix Web Interface in this scenario? What kind of tasks would they perform? What information would they look for?
- Example Thought Process: The IT administrator for the department would be the primary user. They would use the web interface to:
- Add new faculty computers or servers to monitoring.
- Define what specific metrics (items) to collect from each device.
- Set up alert conditions (triggers), e.g., "alert if web server CPU is >90% for 5 mins."
- Create dashboards to get an at-a-glance view of the health of critical systems (e.g., web server status, network bandwidth usage).
- View graphs of historical data to investigate performance issues or plan for upgrades (e.g., "Is web server memory usage trending upwards?").
- Acknowledge and manage active problems/alerts.
-
Items:
- Give three examples of specific "items" you might want to monitor on the department's public-facing web server.
- Example Thought Process:
net.tcp.service[http,,80]
: Checks if the HTTP service on port 80 is responsive (website up/down).system.cpu.load[percpu,avg1]
: Collects the 1-minute average CPU load.vfs.fs.size[/var/www,pfree]
: Collects the percentage of free disk space on the/var/www
partition (where website files might be stored).
-
Triggers:
- For one of the items you listed above (for the web server), define a simple "trigger" condition. What severity would you assign it?
- Example Thought Process: For the item
net.tcp.service[http,,80]
:- Trigger Expression:
{WebServerHostname:net.tcp.service[http,,80].last()}=0
(This means the last check returned 0, indicating the service is down). - Severity: Disaster (because if the public website is down, it's a critical issue).
- Trigger Expression:
-
Notifications:
- If the trigger you defined above fires (website is down), how would the IT administrator want to be notified?
- Example Thought Process: The IT administrator would likely want an immediate notification via multiple channels for such a critical alert:
- Email to their university email address.
- SMS message to their mobile phone.
- Perhaps a message to a team chat application if one is used (e.g., Slack, Microsoft Teams).
Reflection:
Think about how these components interrelate. The agent collects data (defined by items), the server stores it and checks it against triggers, and if a trigger fires, an action (like a notification) occurs, all managed and viewed through the web interface. The proxy helps extend this capability to remote locations efficiently.
This conceptual exercise should help you visualize Zabbix's role and structure before diving into the technical implementation details.
Basic Zabbix
This section delves into the fundamental aspects of Zabbix, guiding you through the initial steps of getting a Zabbix monitoring system up and running. We will cover the installation process, adding your first devices to be monitored, understanding the core concepts of items and triggers for data collection and problem detection, basic data visualization, and user management. Each sub-section is designed to build your foundational knowledge and practical skills, culminating in a workshop to apply what you've learned. By the end of this "Basic Zabbix" section, you will have a functional Zabbix instance monitoring a few key metrics from your systems and a clear understanding of its day-to-day operational basics.
1. Zabbix Installation and Initial Setup
Getting Zabbix installed and configured correctly is the first crucial step. This involves choosing an appropriate deployment method, ensuring your system meets the necessary requirements, installing the various Zabbix components (Server, Frontend, Agent), and performing the initial setup through the web interface. We'll focus primarily on a common scenario: installing Zabbix using official packages on a Linux server, which is a widely adopted and well-supported method.
Choosing Your Zabbix Deployment Method
Zabbix offers several ways to deploy its components, each with its own advantages and considerations. Your choice will depend on your technical expertise, existing infrastructure, and specific requirements.
-
Packages (OS Repositories):
- Description: Zabbix SIA provides official repositories for popular Linux distributions like RHEL/CentOS, Debian/Ubuntu, and others. Using packages is often the most straightforward method for many users.
- Pros:
- Relatively easy installation and updates using standard package managers (
yum
,apt
). - Integration with the operating system's service management (
systemd
,init.d
). - Official support and documentation from Zabbix.
- Relatively easy installation and updates using standard package managers (
- Cons:
- Limited to the operating systems for which packages are provided.
- Version availability might lag slightly behind the absolute latest source release, though official repos are usually up-to-date for major versions.
- Best for: Most users, especially those comfortable with Linux system administration and preferring a well-integrated setup.
-
Containers (Docker):
- Description: Zabbix SIA provides official Docker images for Zabbix server, web interface, agent, and proxy. This method encapsulates Zabbix components and their dependencies.
- Pros:
- Rapid deployment and easy scaling.
- Isolation from the host system, reducing dependency conflicts.
- Consistent environment across different host operating systems that support Docker.
- Simplified upgrades by pulling new images.
- Cons:
- Requires familiarity with Docker and container orchestration concepts (e.g., Docker Compose, Kubernetes).
- Networking and persistent storage for containers need careful configuration.
- Best for: Users familiar with containerization, those looking for quick deployments for testing, or those integrating Zabbix into a microservices architecture.
-
Source Compilation:
- Description: This involves downloading the Zabbix source code and compiling it directly on your server.
- Pros:
- Maximum flexibility to customize compile-time options.
- Ability to install Zabbix on operating systems for which no official packages are available.
- Access to the very latest code, including development versions (if desired).
- Cons:
- Most complex installation method, requiring manual dependency management and compilation steps.
- Upgrades can be more involved.
- Higher potential for errors if not done correctly.
- Best for: Advanced users with specific customization needs or those deploying on unsupported platforms.
-
Virtual Appliances:
- Description: Zabbix provides pre-configured virtual appliance images (e.g., in OVF format) that can be imported into virtualization platforms like VMware, VirtualBox, or Hyper-V.
- Pros:
- Quickest way to get a Zabbix server up and running for testing or small environments.
- Comes with Zabbix and its dependencies pre-installed and pre-configured.
- Cons:
- Might not be suitable for production environments without further hardening and customization.
- Less flexibility in terms of underlying OS configuration compared to a manual install.
- Best for: Quick evaluation, demonstrations, or small, non-critical deployments.
For this guide, we will primarily focus on the package-based installation on a Linux system, as it offers a good balance of ease, control, and suitability for production self-hosting.
System Requirements
Before installing Zabbix, it's essential to ensure your server meets the minimum hardware and software requirements. These requirements can vary based on the number of hosts and items you plan to monitor. For a basic setup monitoring a few dozen hosts, the requirements are quite modest. However, for larger environments, more resources will be needed.
Hardware (Minimum for a small setup - e.g., <100 hosts):
- CPU: 2 cores
- RAM: 2 GB
- Disk Space:
- For Zabbix software and OS: ~10 GB
- For Database: This is the most critical. It depends heavily on the number of monitored items (values per second - VPS) and history/trend storage duration. Start with at least 20-50 GB for a small setup, and be prepared to expand. Fast disk I/O (SSD) is highly recommended for the database.
Software:
- Operating System: A supported Linux distribution (e.g., Ubuntu 20.04/22.04 LTS, Debian 10/11, RHEL/CentOS/Rocky Linux/AlmaLinux 7/8/9).
- Database Server:
- MySQL 5.7 or later (MariaDB 10.5 or later is a common choice)
- PostgreSQL 10 or later (PostgreSQL 13+ recommended)
- Web Server:
- Apache HTTP Server 2.4 or later
- Nginx 1.14 or later
- PHP: Version 7.2.5 or later (with specific extensions like
gd
,bcmath
,mbstring
,sockets
,mysqli
orpgsql
,xmlwriter
,xmlreader
,ldap
,openssl
,ctype
,json
). Zabbix 6.0 LTS requires PHP 7.2.5 to 8.0.x. Zabbix 6.4 requires PHP 7.4.0 to 8.2.x. Always check the official Zabbix documentation for the specific PHP version compatibility with the Zabbix version you are installing.
Network:
- The Zabbix server needs network connectivity to the hosts it will monitor (or to Zabbix proxies).
- Standard ports used by Zabbix:
10050
(TCP): Zabbix agent (passive checks)10051
(TCP): Zabbix server/proxy (for active agent checks, trappers)80/443
(TCP): Zabbix web interface (HTTP/HTTPS)
Important Considerations:
- Database Choice: PostgreSQL is often favored for larger Zabbix installations due to its performance characteristics, especially when combined with TimescaleDB for history tables. MySQL/MariaDB is also perfectly viable.
- Dedicated Server: For production environments, it's highly recommended to run the Zabbix server and its database on a dedicated machine (physical or virtual) to avoid resource contention with other applications.
- Scalability: If you anticipate significant growth, plan your hardware and database strategy accordingly. It's easier to start with a slightly more powerful system than to migrate later due to under-provisioning.
Always refer to the official Zabbix documentation for the most up-to-date and detailed system requirements for the specific Zabbix version you intend to install.
Installing Zabbix Server, Frontend, and Agent (e.g., on Linux using packages)
This sub-section provides a detailed, step-by-step guide for installing Zabbix Server, its web frontend, and a Zabbix Agent on a single Linux machine. We will use Ubuntu 22.04 LTS as the example distribution and PostgreSQL as the database. The steps for other distributions (like CentOS/RHEL) or databases (like MySQL/MariaDB) will be conceptually similar but involve different package manager commands and package names.
Prerequisites:
- A fresh installation of Ubuntu 22.04 LTS.
- Root or sudo privileges.
- Internet connectivity to download packages.
Step 1: Add Zabbix Repository
Zabbix provides official packages. First, download the repository configuration package and install it. For Zabbix 6.0 LTS (as an example, always check for the latest stable LTS or standard release version):
# Go to a temporary directory
cd /tmp
# Download the Zabbix repository package for Ubuntu 22.04 and Zabbix 6.0
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bubuntu22.04_all.deb
# Install the downloaded package
sudo dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
# Update the package list to include Zabbix repository
sudo apt update
- Explanation:
wget
downloads the.deb
package that configures the Zabbix APT repository on your system.dpkg -i
installs this package.apt update
refreshes your local package cache so that APT knows about the packages available from the newly added Zabbix repository.
Step 2: Install Zabbix Server, Frontend, Agent, and Database (PostgreSQL)
We will install the Zabbix server with PostgreSQL support, the Zabbix frontend (which requires a web server like Apache or Nginx; the Zabbix package will pull one in as a dependency), and the Zabbix agent.
# Install Zabbix server with PostgreSQL support, Zabbix frontend, and Zabbix agent
sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent
- Explanation:
zabbix-server-pgsql
: The Zabbix server binary compiled with PostgreSQL support.zabbix-frontend-php
: The PHP files for the Zabbix web interface.php8.1-pgsql
: The PHP module required for PHP to communicate with PostgreSQL (version might vary, checkphp --version
and Zabbix docs).zabbix-apache-conf
: Configuration files to integrate the Zabbix frontend with Apache (which will be installed as a dependency if not present). If you prefer Nginx, you'd installzabbix-nginx-conf
and configure Nginx separately.zabbix-sql-scripts
: Contains SQL scripts needed to create the Zabbix database schema.zabbix-agent
: The Zabbix agent to monitor the local machine itself.
Step 3: Database Setup (PostgreSQL) Zabbix Server requires a dedicated database.
# Install PostgreSQL server (if not already installed as a dependency)
sudo apt install postgresql postgresql-contrib
# Log in to PostgreSQL as the postgres user to create a database and user
sudo -u postgres psql
Inside the psql
shell, execute the following SQL commands:
-- Create a new database user for Zabbix. Replace 'your_strong_password' with a strong password.
CREATE USER zabbix WITH PASSWORD 'your_strong_password';
-- Create a new database for Zabbix, owned by the zabbix user.
CREATE DATABASE zabbix OWNER zabbix;
-- Grant all privileges on the zabbix database to the zabbix user.
GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;
-- Exit psql
\q
- Explanation:
sudo -u postgres psql
: Switches to thepostgres
system user and opens the PostgreSQL command-line interface.CREATE USER zabbix ...
: Creates a new database role (user) namedzabbix
.CREATE DATABASE zabbix ...
: Creates a new database namedzabbix
.GRANT ALL PRIVILEGES ...
: Gives thezabbix
user full control over thezabbix
database.\q
: Exits thepsql
shell.
Step 4: Import Initial Schema and Data into the Zabbix Database
Zabbix provides SQL scripts to create the necessary tables and populate them with initial data.
# Import the initial schema and data for PostgreSQL.
# You will be prompted for the password you set for the 'zabbix' database user.
sudo zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
- Explanation:
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz
: Decompresses the SQL script containing the database schema.| sudo -u zabbix psql zabbix
: Pipes the decompressed SQL script to thepsql
command, which executes it.sudo -u zabbix
attempts to runpsql
as thezabbix
database user (this might require you to configurepg_hba.conf
for password authentication for local connections if it's not set topeer
ortrust
for thezabbix
user, or simply runpsql -U zabbix -d zabbix -W
and paste the content if thesudo -u zabbix
method has permission issues). A more robust way ifsudo -u zabbix
fails is:For simplicity, the original commandsudo -u postgres psql -d zabbix -U zabbix -W -f /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz # Or if the above doesn't work due to file permissions on the .gz, extract it first: # cd /usr/share/zabbix-sql-scripts/postgresql/ # sudo gzip -d server.sql.gz # sudo -u postgres psql -d zabbix -U zabbix -W -f server.sql # Alternatively: # zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | psql -h localhost -U zabbix -W zabbix
sudo zcat ... | sudo -u zabbix psql zabbix
often works ifident
orpeer
authentication is configured for thezabbix
user locally. If it prompts for a password, it's for thezabbix
database user.
Step 5: Configure Zabbix Server
Edit the Zabbix server configuration file to specify the database connection details.
Save the file and exit (Ctrl+X
, then Y
, then Enter
in nano
).
- Explanation: This file (
zabbix_server.conf
) contains various settings for the Zabbix server daemon. TheDBHost
,DBName
,DBUser
, andDBPassword
parameters tell the Zabbix server how to connect to the PostgreSQL database you created.
Step 6: Configure PHP for Zabbix Frontend (Timezone)
The Zabbix frontend requires the correct timezone to be set in the PHP configuration.
The Zabbix Apache configuration file is usually located at /etc/zabbix/apache.conf
. This file often includes PHP settings.
Find the relevant PHP configuration file loaded by Apache. This can be tricky, but often for Apache with php-fpm
, it's in /etc/php/<php_version>/fpm/php.ini
, or for mod_php
in /etc/php/<php_version>/apache2/php.ini
.
For Zabbix 6.0 with PHP 8.1 (as installed):
[Date]
section and uncomment/set the date.timezone
directive. For example:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Berlin
Europe/Berlin
with your actual timezone. A list of supported timezones can be found at https://www.php.net/manual/en/timezones.php.
Save and close the file.
Step 7: Start Zabbix Server and Agent Processes
Enable and start the Zabbix server, Zabbix agent, and Apache web server services.
# Start and enable Zabbix server
sudo systemctl restart zabbix-server
sudo systemctl enable zabbix-server
# Start and enable Zabbix agent
sudo systemctl restart zabbix-agent
sudo systemctl enable zabbix-agent
# Restart Apache to apply PHP changes and Zabbix frontend configuration
sudo systemctl restart apache2
sudo systemctl enable apache2 # If not already enabled
- Explanation:
systemctl restart <service>
: Stops and then starts the specified service.systemctl enable <service>
: Configures the service to start automatically at system boot.- We restart
apache2
so it picks up the Zabbix frontend configuration and any PHP timezone changes.
You can check their status:
sudo systemctl status zabbix-server
sudo systemctl status zabbix-agent
sudo systemctl status apache2
Step 8: Zabbix Frontend Setup via Web Browser
Now, open your web browser and navigate to the Zabbix frontend URL. If Zabbix is installed on the same machine you're using, it might be http://localhost/zabbix
or http://<your_server_ip>/zabbix
.
You will be greeted by the Zabbix setup wizard:
- Welcome screen: Click "Next step".
- Check of pre-requisites: Zabbix will check if all required PHP modules are installed and configured correctly. If any checks fail (show "Fail" in red), you need to install the missing PHP extensions or adjust PHP settings (e.g.,
post_max_size
,max_execution_time
inphp.ini
) and restart Apache. Then, click "Retry" or refresh the page. All checks must pass (show "OK" in green). Click "Next step".- Common missing extensions:
php-gd
,php-bcmath
,php-mbstring
,php-xml
,php-ldap
(if LDAP authentication is planned). Install them usingsudo apt install php8.1-gd php8.1-bcmath php8.1-mbstring php8.1-xml php8.1-ldap
(adjust PHP version as needed) and restart Apache.
- Common missing extensions:
- Configure DB connection:
- Database type: Select "PostgreSQL".
- Database host:
localhost
(or leave empty if the database is on the same server and using Unix sockets, butlocalhost
is safer for TCP/IP connections). - Database port:
5432
(default for PostgreSQL, or 0 if using Unix sockets). - Database name:
zabbix
- User:
zabbix
- Password:
your_strong_password
(the one you set for thezabbix
database user). - Uncheck "TLS encryption" unless you've configured it for your database.
- Click "Next step".
- Zabbix server details:
- Host:
localhost
(or the IP/DNS name of your Zabbix server). - Port:
10051
(default Zabbix server port). - Name: Optional, give your Zabbix server an instance name (e.g., "My Company Zabbix").
- Click "Next step".
- Host:
- Pre-installation summary: Review the settings. Click "Next step".
- Install: The wizard will save the configuration to
/etc/zabbix/web/zabbix.conf.php
. If it reports it cannot write the file, it will provide the content. You'll need to manually create this file on the server and paste the content into it.- If manual creation is needed: Paste the content provided by the wizard, save, and close. Then go back to the browser and click "Retry" or "Finish".
- Permissions for this file are typically:
- Finish: Congratulations! Zabbix frontend installation is complete. Click "Finish".
Initial Login and Dashboard Overview
After completing the frontend setup, you will be redirected to the Zabbix login page.
- Default Username:
Admin
(case-sensitive) - Default Password:
zabbix
Log in with these credentials. It is critically important to change the default Admin password immediately after your first login.
- Changing Admin Password:
- Go to "User settings" (usually an icon or link in the top right or left sidebar, depending on Zabbix version and theme). In modern Zabbix, it's Administration -> Users. Select the "Admin" user.
- Go to the "Password" tab.
- Click "Change password", enter the current password (
zabbix
), and then your new, strong password twice. - Click "Update".
Dashboard Overview:
Upon logging in, you'll typically land on the main Zabbix Dashboard. This is a customizable page that provides a high-level overview of your monitored environment. Initially, it might not show much data since you haven't added many hosts or items yet.
Key elements you might see or can add to a dashboard:
- System information: Status of the Zabbix server itself.
- Problems widget: Displays current unresolved issues detected by triggers.
- Hosts status: A summary of monitored hosts and their availability.
- Graphs: Visual representations of specific metrics.
- Maps: Network topology or geographical maps with status overlays.
- Clock: Current time.
Explore the main menu, typically on the left side or top:
- Monitoring: Access to dashboards, problems, latest data, hosts, maps, etc.
- Configuration: Where you manage hosts, host groups, templates, items, triggers, actions, etc.
- Administration: User management, general settings, proxies, queues, housekeeping, etc.
- Reports: Predefined reports on availability, trends, etc.
Familiarize yourself with the navigation. The Zabbix interface is rich and powerful, so take some time to click around and see what's available.
Workshop Installing Zabbix Server and Agent on a Linux VM
Objective:
To perform a complete installation of Zabbix Server, Web Frontend, and Agent on a fresh Linux Virtual Machine (VM) and log in to the web interface.
Prerequisites:
- A virtualization platform (e.g., VirtualBox, VMware Workstation/Player/Fusion, Hyper-V, KVM).
- An ISO image for Ubuntu 22.04 LTS Server.
- At least 4GB RAM, 2 CPU cores, and 40GB disk space allocated to the VM for a comfortable experience.
- The VM should have network access (NAT with port forwarding or Bridged mode to be accessible from your host machine's browser).
Steps:
-
Create and Prepare the VM:
- Create a new VM using your chosen virtualization software.
- Install Ubuntu 22.04 LTS Server on the VM. During installation:
- Set a hostname (e.g.,
zabbix-srv
). - Create a user with sudo privileges.
- Ensure the OpenSSH server is installed if you want to SSH into the VM (recommended).
- Set a hostname (e.g.,
- Once installed, boot up the VM and log in.
- Update your system:
- Find the IP address of your VM:
ip a
. Note this down, as you'll need it to access the Zabbix frontend from your host machine's browser.
-
Install Zabbix Components (Server, Frontend, Agent):
- Follow Step 1: Add Zabbix Repository from the "Installing Zabbix Server, Frontend, and Agent" section above. Use the Zabbix 6.0 LTS repository for Ubuntu 22.04 (or the latest stable version compatible with your chosen OS, checking the Zabbix website).
- Follow Step 2: Install Zabbix Server, Frontend, Agent, and Database (PostgreSQL).
(Note:
sudo apt install -y zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent postgresql postgresql-contrib
php8.1-pgsql
assumes PHP 8.1 is the default. Checkapt policy php-pgsql
or Zabbix docs for current versions if needed.)
-
Set Up PostgreSQL Database:
- Follow Step 3: Database Setup (PostgreSQL). Remember the strong password you create for the
zabbix
database user. Inpsql
:
- Follow Step 3: Database Setup (PostgreSQL). Remember the strong password you create for the
-
Import Zabbix Schema:
- Follow Step 4: Import Initial Schema and Data into the Zabbix Database.
(If this fails due to authentication, try:
sudo -u postgres psql -U zabbix -d zabbix -W
and paste the output ofzcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz
or use the alternativepsql -h localhost -U zabbix -W zabbix
approach, providing the password when prompted.)
- Follow Step 4: Import Initial Schema and Data into the Zabbix Database.
(If this fails due to authentication, try:
-
Configure Zabbix Server:
- Follow Step 5: Configure Zabbix Server. Edit
/etc/zabbix/zabbix_server.conf
and setDBPassword
to the password you chose.
- Follow Step 5: Configure Zabbix Server. Edit
-
Configure PHP Timezone:
- Follow Step 6: Configure PHP for Zabbix Frontend (Timezone). Edit the correct
php.ini
file (e.g.,/etc/php/8.1/apache2/php.ini
) and setdate.timezone
.
- Follow Step 6: Configure PHP for Zabbix Frontend (Timezone). Edit the correct
-
Start and Enable Services:
- Follow Step 7: Start Zabbix Server and Agent Processes.
- Verify their status:
Check logs if issues arise:
sudo tail -f /var/log/zabbix/zabbix_server.log
andsudo tail -f /var/log/apache2/error.log
.
-
Complete Frontend Setup via Web Browser:
- Follow Step 8: Zabbix Frontend Setup via Web Browser.
- Open a web browser on your host machine (not the VM).
- Navigate to
http://<VM_IP_ADDRESS>/zabbix
(replace<VM_IP_ADDRESS>
with the actual IP of your VM). - Complete the setup wizard steps:
- Ensure all pre-requisites pass.
- Enter the database connection details (Database:
zabbix
, User:zabbix
, Password:YourP@$$wOrd
). - Keep Zabbix server details as default (
localhost
, port10051
). - Finish the installation.
-
Initial Login and Password Change:
- Log in with username
Admin
and passwordzabbix
. - Immediately change the Admin password via User settings (Administration -> Users -> Admin -> Password).
- Log in with username
Verification:
- You should be able to log in to the Zabbix frontend.
- Navigate to Monitoring -> Hosts. You should see a host named "Zabbix server". Initially, its availability might show as "Unknown" or have a red "ZBX" icon if there's an issue with the local agent configuration. We'll fix this in the next sections.
- Check the Zabbix server health: Administration -> General -> Housekeeping. Also, Monitoring -> Dashboard should show some "System information."
Congratulations! You have successfully installed Zabbix. In the next section, we'll learn how to properly add and monitor hosts.
2. Adding Your First Host
With your Zabbix server up and running, the next logical step is to start monitoring actual systems. In Zabbix terminology, any networked device you want to monitor – be it a server, workstation, switch, router, or even a virtual machine – is referred to as a "Host." This section will guide you through understanding hosts and host groups, installing the Zabbix agent on a target system (both Linux and Windows), adding that system as a host in the Zabbix frontend, and verifying that data collection is working.
Understanding Hosts and Host Groups
Hosts:
A "Host" in Zabbix is a fundamental entity representing a networked device that you wish to monitor. Each host has a set of properties, including:
- Host name: A unique name for the host within Zabbix. This name is used for display and referencing in configurations. It does not need to match the system's actual hostname, but it's often a good practice.
- Interfaces: Defines how Zabbix will communicate with the host to collect data. Common interface types include:
- Agent: For hosts running the Zabbix agent. You specify the IP address or DNS name and port (default 10050).
- SNMP: For devices monitored via the Simple Network Management Protocol.
- JMX: For Java applications monitored via Java Management Extensions.
- IPMI: For hardware monitoring via Intelligent Platform Management Interface.
- Linked templates: Templates (discussed later) are pre-defined sets of items, triggers, graphs, etc., that can be applied to hosts to quickly set up monitoring for common services or devices.
- Host group: Every host must belong to at least one host group.
Host Groups:
Host groups are used to logically organize hosts. This organization serves several purposes:
- Logical Grouping: You can group hosts by function (e.g., "Web servers," "Database servers"), location (e.g., "Datacenter A," "Branch Office X"), operating system (e.g., "Linux servers," "Windows servers"), or any other criteria that make sense for your environment.
- Permissions Management: User access to host data and configuration can be granted based on host groups. For example, a database administrator might only have access to the "Database servers" group.
- Configuration Simplification: Actions, maintenance periods, and other configurations can often be applied to entire host groups rather than individual hosts.
- Clarity and Navigation: Host groups make it easier to navigate and manage a large number of hosts in the Zabbix frontend.
A host can belong to multiple host groups. For example, a server named web01.example.com
might belong to "Linux servers," "Web servers," and "Production Environment."
When you first install Zabbix, there are usually some pre-defined host groups like "Linux servers," "Windows servers," "Zabbix servers," etc. You can create your own custom groups as needed.
Installing Zabbix Agent on a Monitored System (Linux and Windows)
To collect detailed operating system and application metrics, you'll typically install the Zabbix agent on the target machine. The Zabbix agent is a lightweight daemon that gathers data locally and sends it to the Zabbix server (or proxy).
Installing Zabbix Agent on Linux (e.g., Ubuntu/Debian or CentOS/RHEL):
The process is similar to installing the Zabbix server, but you only need the zabbix-agent
package.
For Ubuntu/Debian (assuming Zabbix repository is already configured, if not, add it first as shown in the server installation):
Let's assume you want to monitor another Ubuntu 22.04 machine.
On the target machine to be monitored:
-
Add Zabbix Repository (if not already done for Zabbix Server on this machine):
# Go to a temporary directory cd /tmp # Download the Zabbix repository package for Zabbix 6.0 (adjust version if needed) wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bubuntu22.04_all.deb sudo dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb sudo apt update
-
Install Zabbix Agent:
-
Configure Zabbix Agent: The agent configuration file is
Modify the following lines:/etc/zabbix/zabbix_agentd.conf
. You need to edit this file to tell the agent where your Zabbix server is located and what hostname it should identify itself with.Server=
: Specify the IP address or DNS name of your Zabbix server. If the agent is running on the same machine as the server,127.0.0.1
is fine. For a remote agent, use the Zabbix server's actual IP.ServerActive=
: For active checks (where the agent initiates communication to the server), also specify the Zabbix server's IP address or DNS name (often the same asServer
). Active checks are very useful, especially if the agent is behind a firewall or NAT. The format isIP:port
orHostname:port
. The default Zabbix server port for active checks is 10051.Hostname=
: This is a crucial parameter. The hostname specified here must exactly match the "Host name" you will configure in the Zabbix frontend for this host. By default, it usesHostnameItem=system.hostname
. IfHostnameItem
is used andHostname
is commented out or empty, the agent will use the output ofhostname
command (or equivalent for Windows). It's often more reliable to set it explicitly.For this guide, let's use an explicit# Option 1: Let Zabbix agent determine it (default, but ensure it matches frontend) # HostnameItem=system.hostname # Option 2: Set it explicitly (recommended for clarity) Hostname=MyLinuxHost01 # This name must match the host name in Zabbix frontend
Hostname
. Make sure it's unique across your monitored hosts.
Save the file and exit.
-
Start and Enable Zabbix Agent Service:
-
Firewall Configuration (if applicable):
If a firewall (likeufw
on Ubuntu orfirewalld
on CentOS) is running on the Zabbix server, ensure it allows incoming connections on port10051
(for active checks from the agent). If a firewall is running on the Zabbix agent machine, ensure it allows incoming connections on port10050
(for passive checks from the server) if you plan to use passive checks. For active checks, the agent initiates outbound connections, which are usually allowed by default.Example for
Example forufw
on Zabbix Server (to allow active agent connections):ufw
on Zabbix Agent machine (to allow passive checks from server):
For CentOS/RHEL/Rocky Linux/AlmaLinux (example using Zabbix 6.0 repository):
On the target machine to be monitored:
-
Add Zabbix Repository (for RHEL 8 / CentOS 8 based systems):
(Adjust the URL for your specific RHEL/CentOS version and desired Zabbix version based on Zabbix documentation). -
Install Zabbix Agent:
-
Configure Zabbix Agent: Same as for Ubuntu/Debian: edit
/etc/zabbix/zabbix_agentd.conf
. SetServer=
,ServerActive=
, andHostname=
. -
Start and Enable Zabbix Agent Service:
-
Firewall Configuration (if
On Zabbix Agent (for passive checks):firewalld
is used): On Zabbix Server:
Installing Zabbix Agent on Windows:
-
Download the Zabbix Agent Installer:
- Go to the Zabbix download page: https://www.zabbix.com/download_agents
- Select your Windows version (e.g., Windows 10/11/Server 2016/2019/2022), CPU architecture (usually 64-bit amd64), Zabbix version, and encryption (No encryption or OpenSSL).
- Download the MSI installer (e.g.,
zabbix_agent-6.0.0-windows-amd64-openssl.msi
).
-
Run the Installer:
- Execute the downloaded MSI file.
- Accept the license agreement.
- Configuration Page:
- Hostname: Enter the hostname for this machine. This must match the "Host name" you will configure in the Zabbix frontend. Example:
MyWindowsPC01
. - Zabbix server IP/DNS: Enter the IP address or DNS name of your Zabbix server.
- Agent Listen Port:
10050
(default, usually no need to change). - Server or Proxy for active checks: Enter
Your_Zabbix_Server_IP:10051
(replace with your server's IP and port 10051 for active checks). If your server listens on a different port, adjust accordingly. - Enable PSK: Uncheck for now unless you plan to use Pre-Shared Key encryption (covered in advanced topics).
- Check "Add Agent location to PATH".
- Check "Install as a service".
- Hostname: Enter the hostname for this machine. This must match the "Host name" you will configure in the Zabbix frontend. Example:
- Click "Next" and then "Install".
-
Verify Service and Configuration:
- The Zabbix Agent service should be installed and started automatically. You can check this in
services.msc
. - The configuration file is typically located at
C:\Program Files\Zabbix Agent\zabbix_agentd.conf
(orC:\zabbix_agentd.conf
for older versions or if installed in a different path). You can open this file with a text editor to verify theHostname
,Server
, andServerActive
parameters.
- The Zabbix Agent service should be installed and started automatically. You can check this in
-
Windows Firewall: The installer usually attempts to add a firewall rule for the Zabbix agent (port 10050). If not, or if you use a third-party firewall, you may need to manually create an inbound rule to allow traffic on TCP port 10050 from your Zabbix server's IP address if you are using passive checks. For active checks, outbound connections from the agent to the server on port 10051 are needed.
Adding a Host via the Zabbix Frontend
Once the Zabbix agent is installed and configured on the target machine, you need to add this machine as a "Host" in the Zabbix web interface.
-
Navigate to Host Configuration:
- In the Zabbix frontend, go to: Configuration -> Hosts.
-
Create New Host:
- Click the "Create host" button (usually in the top right corner).
-
Configure Host Tab:
- Host name: Enter the exact same hostname that you configured in the
zabbix_agentd.conf
file on the agent machine (or specified during the Windows agent MSI installation). This is critical for Zabbix to link the incoming agent data to this host configuration.- Example:
MyLinuxHost01
orMyWindowsPC01
.
- Example:
- Visible name: (Optional) A more friendly name for display purposes. If left blank, the Host name is used.
- Groups: Select one or more host groups. Start by typing the name of an existing group (e.g., "Linux servers" or "Windows servers") or create a new one by typing a new group name and selecting "(new group)". For our Linux example, you might select "Linux servers". For our Windows example, "Windows servers".
- Interfaces: This is where you define how Zabbix server will communicate with the agent.
- Click the "Add" button in the Interfaces section.
- Select "Agent" from the dropdown.
- IP address: Enter the IP address of the monitored host (the machine where you installed the agent).
- DNS name: Alternatively, enter the DNS name of the monitored host. Zabbix will resolve this to an IP. Use either IP or DNS, not both for the primary interface.
- Connect to: Select "IP" or "DNS" based on what you entered.
- Port:
10050
(default Zabbix agent port). - Leave "Default" checked if this is the primary agent interface.
- Click "Add" (small blue add button within the interface dialog if present, or it adds automatically after filling).
- Host name: Enter the exact same hostname that you configured in the
-
Configure Templates Tab:
- Templates are crucial for quickly applying a set of pre-defined monitoring items, triggers, graphs, etc.
- Go to the "Templates" tab.
- In the "Link new templates" search box, type the name of a suitable template.
- For a Linux host:
Linux by Zabbix agent
(this is a common modern template). Older templates might be namedTemplate OS Linux
. - For a Windows host:
Windows by Zabbix agent
(common modern template). Older:Template OS Windows
.
- For a Linux host:
- Select the template from the filtered list. It will appear under "Linked templates".
- You can link multiple templates if needed.
-
Other Tabs (Optional for basic setup):
- IPMI: For IPMI monitoring.
- SNMP: For SNMP monitoring.
- JMX: For JMX monitoring.
- Macros: For defining host-specific macros (variables).
- Inventory: For manually or automatically populating host inventory data.
- Encryption: For configuring PSK or certificate-based encryption (advanced).
-
Add the Host:
- Click the main "Add" (or "Update" if editing) button at the bottom of the page to save the new host configuration.
Verifying Host Connectivity and Data Collection
After adding the host, Zabbix will attempt to connect to the agent and start collecting data based on the items defined in the linked template(s).
-
Check Host Availability:
- Go to Configuration -> Hosts.
- Find your newly added host in the list.
- Look at the "Availability" column. It may take a few minutes for the status to update.
- You should see a green "ZBX" icon (or other icons like SNMP, JMX, IPMI if those interfaces are used and configured).
- Green ZBX: Indicates that the Zabbix server can communicate with the Zabbix agent on the host.
- Red ZBX: Indicates a communication problem. Common reasons:
- Hostname mismatch between
zabbix_agentd.conf
and Zabbix frontend. - Firewall blocking port 10050 (agent) or 10051 (server for active checks).
- Zabbix agent service not running on the monitored host.
- Incorrect IP address/DNS name for the agent interface in the host configuration.
- Network connectivity issues.
- Hostname mismatch between
- If it's red, hover over the icon for a brief error message. Check Zabbix server logs (
/var/log/zabbix/zabbix_server.log
) and agent logs (/var/log/zabbix/zabbix_agentd.log
on Linux, orzabbix_agentd.log
in the agent's installation directory on Windows) for more details.
-
Check Latest Data:
- Once the availability icon is green, navigate to Monitoring -> Hosts.
- Find your host in the list. Click on "Latest data" for that host (it's a link in one of the columns, or select the host and find a "Latest data" button/menu).
- You should see a list of items (metrics) being collected from the host, along with their last received values and timestamps.
- If you see data flowing in, congratulations! Your host is being monitored.
- If no data appears after several minutes (and availability is green), there might be issues with item configurations, active vs. passive checks, or permissions. Ensure
ServerActive
is correctly configured inzabbix_agentd.conf
if the template uses active items.
-
View Graphs (if available from template):
- Some items, when data is collected, will automatically have graphs. In "Latest Data", some items might have a "Graph" link.
- Alternatively, go to Monitoring -> Hosts, click on the host name, and then look for a "Graphs" sub-menu or tab.
By following these steps, you've successfully added a new system to your Zabbix monitoring setup and started collecting data from it.
Workshop Monitoring Your First Linux Server
Objective:
To install Zabbix agent on the same Linux VM where the Zabbix server is running (to monitor the server itself), configure it, add it as a host in Zabbix frontend, and verify data collection.
Prerequisites:
- Your Zabbix server VM from the previous workshop is running.
- You can access the Zabbix frontend via your browser.
Scenario:
We will monitor the Zabbix server machine itself. The Zabbix agent was likely installed as a dependency during the server setup. We just need to configure it correctly and add the host in the frontend.
Steps:
-
Verify Zabbix Agent Installation on the Zabbix Server VM:
- SSH into your Zabbix server VM or use its console.
- The
zabbix-agent
package should already be installed from the previous workshop. Verify: It should show as installed. If not, install it:
-
Configure the Local Zabbix Agent:
- Edit the agent configuration file:
-
Make the following changes:
Server=127.0.0.1
(Since the server is on the same machine)ServerActive=127.0.0.1
(For active checks, also pointing to the local server)Hostname=Zabbix server
(This is the default hostname Zabbix uses for its own server if you don't change it during frontend setup. Crucially, this MUST match the "Host name" field in the Zabbix frontend host configuration. Zabbix automatically creates a host for "Zabbix server" during its initial setup. We are essentially configuring the local agent to match this pre-existing host entry).- Alternatively, you could set
Hostname=zabbix-srv
(or whatever actual hostname you gave your VM) and then either rename the "Zabbix server" host in the frontend or create a new host entry withzabbix-srv
. For simplicity now, we'll stick withHostname=Zabbix server
to match the default.
- Alternatively, you could set
-
Save the file and exit.
-
Restart the Zabbix Agent:
-
Configure the "Zabbix server" Host in Zabbix Frontend:
- Open your Zabbix frontend in a browser.
- Navigate to Configuration -> Hosts.
- You should see a host named "Zabbix server" already listed. This host is created by default during Zabbix installation to monitor the Zabbix server itself.
- Click on the name "Zabbix server" to edit its configuration.
-
Host tab:
- Host name: Verify it is
Zabbix server
. - Groups: It should be in "Zabbix servers" and possibly "Linux servers".
- Interfaces:
- There should already be an agent interface configured, likely pointing to
127.0.0.1
on port10050
. If not, or if it's incorrect:- Click "Add" under Interfaces.
- Type: Agent
- IP address:
127.0.0.1
- Port:
10050
- Ensure "Default" is checked.
- Click the small "Add" link within the interface section if needed, or it might be added directly. If an old incorrect one exists, remove it.
- There should already be an agent interface configured, likely pointing to
- Host name: Verify it is
-
Templates Tab:
- By default, the "Zabbix server" host might not have many templates, or just a basic one. Let's link a comprehensive Linux monitoring template.
- In the "Link new templates" search box, type
Linux by Zabbix agent
. - Select "Linux by Zabbix agent" from the search results. It will appear in the "Linked templates" section.
- (Optional: If there's an older, less comprehensive Linux template linked, you might consider unlinking it by clicking "Unlink" or "Unlink and clear" next to it, but be cautious if you're unsure.)
-
Update the Host:
- Click the "Update" button at the bottom.
-
Verify Monitoring:
- Go back to Configuration -> Hosts.
-
Find the "Zabbix server" host. After a minute or two, the "Availability" column's "ZBX" icon should turn green.
- If it stays red, double-check:
Hostname
in/etc/zabbix/zabbix_agentd.conf
exactly matches "Host name" in the frontend.- Agent interface IP and port in frontend are correct (
127.0.0.1
, port10050
). zabbix-agent
service is running on the VM.- Check agent logs:
sudo tail -f /var/log/zabbix/zabbix_agentd.log
- Check server logs:
sudo tail -f /var/log/zabbix/zabbix_server.log
(look for messages related to "Zabbix server" host).
- If it stays red, double-check:
-
Once the ZBX icon is green, go to Monitoring -> Latest data.
- In the "Hosts" filter, select "Zabbix server" and click "Apply".
- You should now see many items from the "Linux by Zabbix agent" template populating with data (CPU load, memory usage, disk space, network traffic, etc.). This might take a few minutes to fully populate.
Bonus Task (Monitoring a Second Remote Linux VM - Optional):
If you have another Linux VM available (different from your Zabbix server VM):
- Install Zabbix agent on that second VM following the Linux agent installation steps from the main content.
- In its
/etc/zabbix/zabbix_agentd.conf
:- Set
Server=
to the IP address of your Zabbix Server VM. - Set
ServerActive=
to the IP address of your Zabbix Server VM (e.g.,Your_Zabbix_Server_VM_IP:10051
). - Set
Hostname=
to a unique name, e.g.,MyRemoteLinuxVM01
. - Restart the agent.
- Ensure firewall on Zabbix Server VM allows port 10051/tcp and firewall on Remote VM allows 10050/tcp from Zabbix Server IP if using passive checks.
- Set
- In Zabbix frontend (Configuration -> Hosts -> Create host):
- Host name:
MyRemoteLinuxVM01
- Groups: "Linux servers"
- Interfaces: Add Agent interface with the IP address of
MyRemoteLinuxVM01
and port10050
. - Templates: Link "Linux by Zabbix agent".
- Click "Add".
- Host name:
- Verify its availability and latest data as done for the "Zabbix server" host.
This workshop ensures you can monitor the Zabbix server itself and provides a template for adding other Linux systems. You now have a practical understanding of how agents and host configurations work together.
3. Understanding Items and Triggers
At the heart of Zabbix's data collection and problem detection capabilities are "Items" and "Triggers." Items define what specific data you want to collect from your monitored hosts, while Triggers analyze this collected data to determine if a problem state exists. Mastering these two concepts is fundamental to effectively using Zabbix for monitoring.
What are Items?
An Item in Zabbix is a specific piece of data that you want to retrieve from a monitored host. Each item defines:
- What data to collect: This is specified by an "Item Key."
- How often to collect it: This is the "Update interval."
- What type of data it is: Numeric, character, log, text, etc.
- How long to store the history and trends: "History storage period" and "Trend storage period."
- Any preprocessing steps: Transformations to apply to the collected data before storing it.
- And other parameters like units, application groupings, etc.
Item Keys:
The item key is a unique string that identifies the data to be collected. Zabbix has a vast number of pre-defined item keys, especially for the Zabbix agent. These keys are often structured and intuitive.
-
Syntax:
key[parameter1,parameter2,...]
key
: The base name of the metric (e.g.,system.cpu.load
,net.if.in
,vfs.fs.size
).parameters
: Optional parameters that qualify the key (e.g., forsystem.cpu.load
, parameters can specify per CPU, average, etc.; fornet.if.in
, the network interface name).
-
Common Zabbix Agent Item Key Examples:
system.cpu.load[percpu,avg1]
: Average CPU load over 1 minute, per CPU core.vm.memory.size[available]
: Available memory in bytes.vfs.fs.size[/,pfree]
: Percentage of free disk space on the root filesystem (/
).net.if.in[eth0,bytes]
: Incoming network traffic in bytes on interfaceeth0
.net.if.out[eth0,bytes]
: Outgoing network traffic in bytes on interfaceeth0
.agent.ping
: Checks if the agent is responsive (returns 1 if alive, 0 otherwise).proc.num[<name>,<user>,<state>,<cmdline>]
: Number of processes matching criteria. E.g.,proc.num[httpd]
counts processes namedhttpd
.system.hostname
: Returns the hostname of the agent machine.log[/var/log/syslog,"error"]
: Monitors a log file for lines containing "error".web.page.perf[host,path,port]
: Checks web scenario performance.
The full list of available item keys for different Zabbix agent versions and other check types (SNMP, IPMI, etc.) can be found in the official Zabbix documentation.
Data Types:
Zabbix supports various data types for items:
- Numeric (unsigned): For non-negative integers (e.g., counts, traffic).
- Numeric (float): For decimal numbers (e.g., CPU load, temperature).
- Character: For short text strings (max 255 bytes).
- Log: For log entries, typically has extended properties like timestamp, source, severity.
- Text: For long text data.
- Boolean: Stored as 0 or 1, represented as "False" or "True" (new in Zabbix 6.x). Older versions use numeric 0/1.
Choosing the correct data type is important for storage efficiency and for how triggers and functions can operate on the data.
Update Intervals:
This defines how frequently Zabbix server (for passive checks) or Zabbix agent (for active checks) will attempt to collect the value for this item.
- Expressed in seconds (e.g.,
30s
,1m
,2h
,1d
). - Can also be defined using custom intervals with scheduling (e.g., "collect only during business hours").
- Choosing appropriate update intervals is a balance:
- Shorter intervals: More granular data, faster problem detection, but higher load on Zabbix server, agent, and database.
- Longer intervals: Less load, but less granular data and slower detection.
History and Trend Storage Periods:
- History storage period: How long Zabbix will keep the exact collected values (raw data). Expressed in days (e.g.,
7d
,30d
,90d
). - Trend storage period: How long Zabbix will keep aggregated (min, max, average, count) values calculated over each hour. Trends require less disk space than history. Expressed in days (e.g.,
365d
,730d
). - The Zabbix Housekeeper process is responsible for deleting old history and trend data.
Items are typically not created individually for each host. Instead, they are defined within Templates, which are then linked to hosts. This promotes reusability and consistency.
Creating Custom Items
While templates provide many common items, you may occasionally need to monitor something specific for which no pre-defined item key exists. Zabbix allows you to create custom items, often using:
-
UserParameter (on Zabbix Agent):
- This is the most common way to add custom checks executed by the Zabbix agent.
- You define a
UserParameter
in the agent's configuration file (zabbix_agentd.conf
). - Syntax:
UserParameter=<key[*]>,<command>
<key[*]
: The item key you want to use in Zabbix frontend. The[*]
allows you to pass parameters from the frontend to your command.<command>
: The shell command or script that will be executed by the agent. The output of this command will be the value of the item.
- Example: To monitor the number of active SSH sessions on a Linux host:
In
/etc/zabbix/zabbix_agentd.conf
: Then, in Zabbix frontend, you would create an item on the host (or in a template) with the keyssh.users.active
. - After adding a
UserParameter
, you must restart the Zabbix agent.
-
External Checks (on Zabbix Server/Proxy):
- These are custom scripts executed by the Zabbix server or proxy.
- The script must be placed in the directory defined by
ExternalScripts
inzabbix_server.conf
(orzabbix_proxy.conf
). - The item key in Zabbix frontend will be the script's filename, and parameters can be passed to it.
- Useful for checks that need to be run from the server's perspective or involve more complex logic.
-
Other check types: SSH checks, Telnet checks, Calculated items, Dependent items (covered in Intermediate section).
When creating custom items, ensure your scripts are efficient, secure, and output data in a consistent format that Zabbix expects.
What are Triggers?
A Trigger in Zabbix is a logical expression that defines a problem threshold or condition based on the data collected by items. When the expression evaluates to TRUE, the trigger changes its state to "Problem." When it evaluates to FALSE, it reverts to "OK."
Triggers are the core of Zabbix's alerting system. They turn raw data into actionable events.
Trigger Expressions and Functions:
Trigger expressions are built using:
-
Item references:
{Hostname:item.key.function(parameters)}
Hostname
: The host name as defined in Zabbix.item.key
: The key of the item to evaluate.function()
: A trigger function applied to the item's data. Common functions include:last()
: The very last value received.avg(time_period)
: Average value over a time period (e.g.,avg(5m)
).min(time_period)
: Minimum value over a time period.max(time_period)
: Maximum value over a time period.sum(time_period)
: Sum of values over a time period.count(time_period,value,operator)
: Number of values matching criteria.nodata(time_period)
: Becomes TRUE if no data received for the item intime_period
.change()
: Difference between the last and previous value.str(pattern)
: Checks if a string contains a pattern.regexp(pattern)
: Checks if a string matches a regular expression.
- Parameters for functions can be seconds (e.g.,
300
for 5 minutes), or #N for Nth latest value (e.g.last(#5)
for 5th latest value).
-
Operators:
- Comparison:
>
,<
,>=
,<=
,=
,<>
(not equal) - Logical:
and
,or
,not
- Comparison:
-
Constants: Numeric values or strings.
Examples of Trigger Expressions:
-
High CPU Load:
- Item:
system.cpu.load[percpu,avg1]
(1-minute average CPU load) - Expression:
{MyLinuxHost01:system.cpu.load[percpu,avg1].last()} > 5
- Meaning: If the last CPU load value on
MyLinuxHost01
is greater than 5, trigger a problem.
- Item:
-
Low Disk Space (using average over 5 minutes to avoid flapping):
- Item:
vfs.fs.size[/,pfree]
(percentage of free disk space on root) - Expression:
{MyLinuxHost01:vfs.fs.size[/,pfree].avg(5m)} < 10
- Meaning: If the average percentage of free disk space on
/
over the last 5 minutes is less than 10%, trigger a problem.
- Item:
-
Service Down (agent.ping is 0 if agent is unreachable):
- Item:
agent.ping
- Expression:
{MyLinuxHost01:agent.ping.last()} = 0
- Meaning: If the agent ping fails (returns 0), trigger a problem.
- Item:
-
Web Server Process Not Running (using proc.num):
- Item:
proc.num[httpd]
(number of processes named httpd) - Expression:
{MyWebServer:proc.num[httpd].last()} < 1
- Meaning: If the number of
httpd
processes is less than 1, trigger a problem.
- Item:
-
Log Contains Error Message:
- Item:
log[/var/log/messages,"error"]
- Expression:
{MyLinuxHost01:log[/var/log/messages,"error"].str("Out of memory")} = 1
- (Note: The
str
function in this context applied to a log item often looks for the string within the newly collected log lines that match the item's filter. Thelog
item itself might return the matching line. A more common way to use log monitoring for triggers is to count occurrences or usenodata
if logs are expected regularly.) A more typical log trigger might be based on thelogeventid
if you're using event IDs, or count specific patterns over time. For simple pattern matching, the item configuration itself does the filtering. The trigger then fires if any such line is found. A trigger for a log item configured to find "error" might be:{MyLinuxHost01:log[/var/log/messages,"error"].regexp("SpecificCriticalErrorPattern",60)} = 1
This means if "SpecificCriticalErrorPattern" is found in the log lines (that already matched "error") within the last 60 seconds.
- (Note: The
- Item:
Severity Levels:
Each trigger is assigned a severity level to indicate the importance of the problem. Zabbix has default severity levels:
- Not classified: (Gray)
- Information: (Light Blue) - Useful for informational events, not necessarily problems.
- Warning: (Yellow) - Indicates a potential issue or a minor problem.
- Average: (Orange) - A moderate problem that requires attention.
- High: (Light Red) - A serious problem that needs prompt attention.
- Disaster: (Dark Red) - A critical, system-down type of problem.
Severities help in filtering problems in the dashboard and in configuring notification rules (e.g., only send SMS for Disaster-level events).
Dependencies:
Triggers can have dependencies on other triggers. If a trigger depends on another, it will not change its state to "Problem" if the trigger it depends on is already in a "Problem" state.
- Example: If a trigger "Router Unreachable" is in a Problem state, you might not want triggers like "Server X Unreachable" (for servers behind that router) to also fire, as they are symptoms of the router issue.
- This helps reduce alert noise and focus on the root cause.
Creating Basic Triggers
Triggers are usually created within templates, but you can also add them directly to a host if needed (though less recommended for maintainability).
Let's consider creating a trigger for an item:
-
Navigate to Trigger Configuration:
- If adding to a template: Configuration -> Templates -> [Your Template] -> Triggers -> Create trigger.
- If adding directly to a host (not ideal for reusability): Configuration -> Hosts -> [Your Host] -> Triggers -> Create trigger.
-
Configure Trigger Properties:
- Name: A descriptive name for the trigger. It often includes macros like
{HOST.NAME}
to be generic.- Example:
{HOST.NAME}: High CPU utilization
- Example:
- Severity: Select the appropriate severity level from the dropdown.
- Expression: This is the core. Click "Add" next to the expression field to open the expression constructor (or type it manually if you know the syntax).
- Expression Constructor:
- Click "Select" to choose the item you want to base the trigger on.
- Choose the function (e.g.,
last()
,avg()
). - Enter any parameters for the function (e.g.,
5m
for 5 minutes). - Choose the operator (e.g.,
>
,<
,=
). - Enter the threshold value (e.g.,
80
for 80%). - Click "Insert".
- You can build more complex expressions using
and
,or
, and multiple conditions.
- Expression Constructor:
- OK event generation:
- Expression: Default, recovers when the problem expression is false.
- Recovery expression: Define a separate expression for recovery (less common for basic triggers).
- None: Trigger never recovers automatically, must be closed manually.
- Problem event generation mode:
- Single: Generates one problem event until resolved.
- Multiple: Generates a problem event every time the trigger expression evaluates to true, even if it's already in a problem state (use with caution, can be noisy).
- Allow manual close: If checked, users can manually acknowledge and close the problem even if the condition persists.
- Description: (Optional but recommended) Detailed information about the problem, potential causes, and suggested remediation steps. Can use macros.
- Tags: For categorizing and filtering events.
- Dependencies: (Optional) Define dependencies on other triggers.
- Name: A descriptive name for the trigger. It often includes macros like
-
Add the Trigger:
- Click the "Add" (or "Update") button.
Once a trigger is created and enabled, Zabbix will start evaluating its expression based on the incoming data for the associated item(s). If the condition is met, a problem event will be generated and displayed in Monitoring -> Problems.
Workshop Creating an Item and Trigger for Disk Space Monitoring
Objective:
To create a custom UserParameter on a Linux agent to check the disk space of a specific mount point (e.g., /home
), then create an item and a trigger in Zabbix frontend to monitor this and alert if free space is low.
Prerequisites:
- A Linux host (e.g., your Zabbix server VM, or the
MyRemoteLinuxVM01
if you set one up) is being monitored by Zabbix, with the agent running. - You have SSH access to this Linux host.
- You have access to the Zabbix frontend.
Scenario:
We want to specifically monitor the percentage of free disk space on the /home
partition (or /
if /home
is not separate) of our chosen Linux host and get an alert if it drops below 20%.
Part 1: Create UserParameter on the Monitored Linux Host
-
SSH into your target Linux host. (This could be your Zabbix server VM itself).
-
Determine the mount point:
- Run
df -h
to see your filesystems. Identify the one you want to monitor (e.g.,/home
or/
). For this workshop, let's assume/home
is a distinct mount point. If not, use/
.
- Run
-
Test the command to get percentage free space: The
This gives the percentage used. We want percentage free. So, 100 minus percentage used. Or, a command to get free space directly: To get blocks free:df
command can give us this. We need to parse its output. Example command to get percentage of used space for/home
:df /home --output=avail | tail -n 1
To get total blocks:df /home --output=size | tail -n 1
A simpler way for percentage free (thoughdf
itself doesn't directly give this in a clean, single number for parsing across alldf
versions easily for "free percent"): Let's make a UserParameter that returns the used percentage, and we'll handle the "less than X% free" logic in the trigger (i.e., "more than Y% used"). Command for percentage used for/home
: If yourdf
doesn't support--output
, try: Test this command. It should output a number (e.g.,15
if 15% used). -
Add UserParameter to
Add the following line (preferably at the end of the file or in the UserParameter section):zabbix_agentd.conf
:# UserParameter for /home disk usage (percentage used) # Usage: custom.vfs.fs.pused[/home] UserParameter=custom.vfs.fs.pused[*],df $1 --output=pcent | tail -n1 | tr -d ' %'
- Explanation:
custom.vfs.fs.pused[*]
: This is our custom item key. The[*]
means it accepts parameters.$1
: This will be replaced by the first parameter passed from the item key in Zabbix frontend (e.g.,/home
).- The command is the one we tested.
- If you chose the
awk
version of the command:
- Explanation:
-
Restart Zabbix Agent:
-
Test UserParameter from Zabbix Server (Optional but Recommended): If your Zabbix server is a different machine than the agent, you can use
Replacezabbix_get
utility from the Zabbix server to test this new UserParameter. (If testing on the agent machine itself, you can usezabbix_agentd -t custom.vfs.fs.pused[/home]
). On the Zabbix Server machine (installzabbix-get
if not present:sudo apt install zabbix-get
):<IP_OF_AGENT_HOST>
with the IP of the Linux host where you configured the UserParameter. It should return the percentage of disk space used for/home
. If it doesn't work, check agent logs on the target host.
Part 2: Create Item and Trigger in Zabbix Frontend
-
Navigate to Host or Template Configuration:
- Decide if you want this item/trigger on a specific host or in a template (recommended for reusability). For this workshop, let's add it to the "Zabbix server" host (assuming
/home
is relevant there, or use/
and adjust the UserParameter and item key accordingly). - Go to Configuration -> Hosts. Click on "Zabbix server" (or your chosen Linux host).
- Go to the Items tab.
- Decide if you want this item/trigger on a specific host or in a template (recommended for reusability). For this workshop, let's add it to the "Zabbix server" host (assuming
-
Create the Item:
- Click "Create item".
- Name:
Disk space usage on /home (percentage used)
- Type:
Zabbix agent
(this is for passive checks by default, which is fine for UserParameters. If you want active, selectZabbix agent (active)
and ensureServerActive
is correctly set in agent conf). - Key:
custom.vfs.fs.pused[/home]
- This matches the UserParameter key.
/home
is passed as the parameter$1
to our script. If monitoring root/
, usecustom.vfs.fs.pused[/]
.
- This matches the UserParameter key.
- Host interface: Select the agent interface of your host (usually pre-selected if only one).
- Type of information:
Numeric (unsigned)
(since percentage is 0-100). - Units:
%
- Update interval:
1m
(for testing, you can set it shorter, like30s
; for production,5m
or10m
might be more appropriate). - History storage period:
7d
(default is often90d
, adjust as needed). - Trend storage period:
365d
(default). - Applications: You can create a new application like
Disk Space
or add to an existing one. TypeDisk Space
and click Enter or select from dropdown if it appears. This helps organize items. - Click "Add".
-
Verify Item Data Collection:
- Go to Monitoring -> Latest data.
- Filter by your host.
- Find your new item:
Disk space usage on /home (percentage used)
. - It might take a minute or two for the first value to appear. If no data comes, check:
zabbix_get
test from Part 1.- Agent logs on the monitored host.
- Server logs on the Zabbix server.
- Ensure the item key exactly matches the UserParameter definition.
-
Create the Trigger:
- Once you see data for the item, go back to Configuration -> Hosts -> [Your Host] -> Triggers.
- Click "Create trigger".
- Name:
{HOST.NAME}: /home disk space is critically low (less than 20% free)
- Severity:
High
(orAverage
, depending on your policy). - Expression:
- We want to trigger if free space is less than 20%. Our item gives used percentage. So, if used percentage is greater than 80%, then free space is less than 20%.
- Click "Add" next to the expression field.
- Item: Click "Select", find and choose your item
Disk space usage on /home (percentage used)
for the correct host. - Function:
Last (most recent) T value is N
(this islast()
). Keep T as1
(default for last value is okay, or you could useavg(5m)
to avoid flapping for rapidly changing values). - Operator:
>
(greater than) - N (Value):
80
- The generated condition will look something like:
last(/Zabbix server/custom.vfs.fs.pused[/home])>80
(The host/item path might look different in older Zabbix versions or if you used a template). - Alternatively, using the expression builder:
Select Item:
Disk space usage on /home (percentage used)
Function:last()
Result:> 80
(or the value corresponding to your desired free space threshold, e.g., if you want alert at <10% free, then >90% used) - Click "Insert".
- Description: (Optional but good practice)
(Note:
The /home partition on {HOST.NAME} is running out of space. Used: {{ITEM.LASTVALUE1}.1} % (Threshold: >80%) Free space is less than 20%. Please investigate and free up disk space.
{ITEM.LASTVALUE1}
refers to the last value of the first item in the expression). - Ensure "Enabled" is checked.
- Click "Add".
-
Test the Trigger (Optional, by filling up disk space):
- This is the tricky part. To test, you would need to actually make the disk usage on
/home
(or/
) on your monitored host exceed 80%. - Be very careful if doing this on a production system or your Zabbix server itself! Only do this if you know how to safely create and remove large files.
- Example (use with extreme caution):
On the monitored Linux host:
# Check current usage of /home df -h /home # Create a large dummy file in /home/your_user directory (e.g., 1GB) # Adjust 'count' based on your disk size and how much you need to fill # Ensure you have enough free space to not fill it completely by accident! # dd if=/dev/zero of=/home/your_user/dummyfile.img bs=1M count=1024 # Creates a 1GB file
- Wait for Zabbix to pick up the new disk usage (based on item's update interval).
- Go to Monitoring -> Problems in Zabbix frontend. If the threshold is crossed, your new trigger should appear as a problem.
- IMPORTANT: Delete the dummy file afterwards!
- The problem in Zabbix should eventually clear automatically once the disk usage drops below the threshold again (after the item updates).
- This is the tricky part. To test, you would need to actually make the disk usage on
This workshop gives you hands-on experience with defining custom data collection (UserParameter), creating a Zabbix item to gather that data, and building a trigger to alert on specific conditions based on that data. This is a core workflow in tailoring Zabbix to your specific needs.
4. Basic Graphing and Visualization
Collecting data is only half the battle; understanding it is equally important. Zabbix provides robust graphing and visualization tools to help you interpret the vast amounts of data it collects. This allows you to observe trends, spot anomalies, and diagnose issues more effectively. This section introduces the basics of Zabbix's graphing capabilities, how to create simple graphs, customize their appearance, and get an initial look at dashboards.
Overview of Zabbix Graphing Capabilities
Zabbix can generate graphs for any numerical item it collects. These graphs are invaluable for:
- Trend Analysis: Observing how metrics change over time (e.g., is CPU usage gradually increasing? Is disk space consistently decreasing?).
- Performance Monitoring: Visualizing performance metrics like response times, throughput, and resource utilization.
- Capacity Planning: Identifying long-term trends that might indicate a need for resource upgrades.
- Troubleshooting: Correlating different metrics on a graph to understand the context of a problem (e.g., did a spike in network traffic coincide with high CPU load?).
Zabbix offers two main types of graphs:
-
Simple Graphs:
- Automatically available for any numeric item.
- Provide a quick way to visualize the history of a single item.
- Accessible directly from "Latest data" or item configuration lists.
- Limited customization options but very convenient for ad-hoc analysis.
-
Custom Graphs:
- Allow you to combine multiple items onto a single graph.
- Offer extensive customization options for appearance (colors, line styles, Y-axis scales, etc.).
- Can be added to Templates, Screens, and Dashboards for consistent visualization across multiple hosts or for specific views.
Graphs in Zabbix are generated on-the-fly based on the historical data stored in the database. You can zoom in/out and select different time periods for viewing.
Creating Simple Graphs for Items
Simple graphs are the easiest way to start visualizing your data.
-
Accessing Simple Graphs:
- Navigate to Monitoring -> Latest data.
- Use the filters (Host groups, Hosts, Applications, Tags, Name) to find the host and item you are interested in. For example, filter for your "Zabbix server" host and look for an item like "CPU utilization" or "Memory usage".
- In the list of items, items that have collected numeric data and have history will typically have a "Graph" link in the last column (or a similar "History" link that leads to data and graph options).
- Clicking this "Graph" link will take you to a page displaying the simple graph for that specific item.
-
Interpreting the Simple Graph:
- Time Period Selector: Above the graph, you'll find controls to change the time period being displayed (e.g., last 1 hour, 6 hours, 1 day, 7 days, custom range).
- Data Points: The graph will show the item's values over the selected time period.
- Legend: Usually displays the item name, and min/avg/max values for the selected period.
- Navigation: You can often click and drag on the graph to zoom into a specific time range. Use the controls to zoom out or shift the time period.
Simple graphs are excellent for quick checks but lack the flexibility of custom graphs if you need to compare multiple items or have more control over the presentation.
Values/500 latest values:
When viewing simple graphs or item history, you might also see options like "Values" or "500 latest values." This displays the raw data points in a table format, which can be useful for seeing exact figures.
Customizing Graph Appearance (via Custom Graphs)
While simple graphs are auto-generated, Custom Graphs offer much more control. Custom graphs are typically defined within Templates (so they apply to all hosts using that template) or sometimes directly on a Host (less common).
Let's explore how to create or modify a custom graph, assuming you are working within a template:
-
Navigate to Graph Configuration in a Template:
- Go to Configuration -> Templates.
- Select a template that is linked to your host and contains numeric items you want to graph (e.g., "Linux by Zabbix agent").
- In the template's properties, find and click on "Graphs".
- You'll see a list of existing custom graphs in that template. You can click "Create graph" to make a new one, or click on an existing graph name to edit it.
-
Creating/Editing a Custom Graph:
- Name: A descriptive name for the graph (e.g., "CPU Overview", "Network Traffic on eth0").
- Width / Height: Dimensions of the graph in pixels.
- Graph type:
- Normal: Standard line graph.
- Stacked: Values of multiple items are stacked on top of each other. Useful for showing parts of a whole (e.g., different components of CPU usage like user, system, iowait).
- Pie / Exploded Pie: For showing proportions (less common for time-series data).
- Show legend: Checkbox to display the legend.
- Show working time / Show triggers: Overlays working hours or trigger thresholds on the graph (can be very useful).
- Y axis MIN value / Y axis MAX value:
- Calculated: Zabbix automatically determines the Y-axis scale based on the data.
- Fixed: You can set specific minimum and maximum values for the Y-axis. Useful for consistent scaling across graphs or when you know the expected range of an item.
-
Items: This is where you add the data series to your graph.
- Click "Add" in the Items section.
- Item: Click "Select" and choose the item you want to plot from the items available in the template (or host, if creating a host-level graph).
- Draw style: How the item is drawn (Line, Filled region, Bold line, Dot, Dashed line).
- Color: Choose a color for this item's line/fill.
- Y axis side: Left or Right. Allows you to have two different scales if items have vastly different value ranges (e.g., plotting CPU % on left Y-axis and network traffic in Mbps on right Y-axis).
- Function: (Optional) Instead of plotting raw values, you can plot an aggregate (All, Min, Avg, Max) for each interval on the graph. "All" usually shows min, avg, and max as a band.
-
Example: Creating a CPU Usage Graph with User, System, and Idle Time:
- Name:
CPU Utilization Details
- Graph type:
Stacked
- Items:
- Add Item:
CPU user time
(or similar key likesystem.cpu.util[,user]
) -> Color: Blue, Draw style: Filled region - Add Item:
CPU system time
(system.cpu.util[,system]
) -> Color: Red, Draw style: Filled region - Add Item:
CPU iowait time
(system.cpu.util[,iowait]
) -> Color: Yellow, Draw style: Filled region - Add Item:
CPU idle time
(system.cpu.util[,idle]
) -> Color: Green, Draw style: Filled region (Ensure these exact item keys exist in your template/host, names might vary slightly, e.g.,CPU idle time
,CPU user time
, etc.)
- Add Item:
- Name:
-
Save the Graph:
- Click "Add" (if creating new) or "Update" (if editing).
Once a custom graph is defined in a template and that template is linked to a host, you can view this graph for that host:
- Go to Monitoring -> Hosts.
- Click on the host name.
- Select the "Graphs" sub-menu/tab for that host.
- You should find your custom graph listed there.
Introduction to Screens and Dashboards
While individual graphs are useful, often you want to see multiple pieces of information (graphs, trigger statuses, raw values) on a single page. Zabbix provides two main ways to achieve this: Screens (older concept, still functional) and Dashboards (more modern and flexible).
Screens (Global and Template-level):
- Screens are custom-defined pages that can display a grid of various elements, including:
- Simple graphs
- Custom graphs
- Plain text (latest value of an item)
- Server information
- Trigger overview
- Host status, etc.
- You define the number of rows and columns for the grid.
- Screens can be created globally (Monitoring -> Screens) or within templates (Configuration -> Templates -> [Template Name] -> Screens). Template screens become available for any host linked to that template.
- Use Case: Creating a dedicated view for a specific server showing its key performance graphs and critical trigger statuses all in one place.
Dashboards (Global and User-level):
- Dashboards are the primary landing page in modern Zabbix versions and are highly customizable.
- They are composed of "widgets." Each widget displays a specific type of information.
- Available Widgets (examples):
- Graph (can display custom graphs or ad-hoc simple graphs)
- Problem hosts
- Problems (list of current issues)
- System information
- Clock
- Map
- URL (embed external content)
- Action log
- Data overview (table of item values)
- Global Dashboards: Created under Monitoring -> Dashboard. Administrators can create multiple global dashboards and set one as default.
- User-Specific Dashboards: Each user can create and customize their own dashboards.
- Flexibility: Widgets can be resized and rearranged easily using a drag-and-drop interface.
- Use Case:
- Creating a NOC (Network Operations Center) display showing overall system health, top problems, and key performance indicators.
- A personal dashboard for a sysadmin focusing on the systems they are responsible for.
- A dashboard per application or service.
Creating/Modifying a Dashboard:
- Navigate to Monitoring -> Dashboard.
- You might see a default dashboard. To create a new one or edit, look for buttons like "Create dashboard" or an "Edit dashboard" option (often a gear icon or a toggle switch).
- When editing or creating:
- Give the dashboard a Name.
- You can add widgets by clicking an "Add widget" button.
- For each widget, you configure its specific settings (e.g., for a Graph widget, you select which graph to display or define an ad-hoc graph by picking items).
- Arrange and resize widgets as needed.
- Save the dashboard.
Dashboards are generally preferred for their flexibility and modern interface over Screens for general overview purposes, though Screens can still be useful for specific, structured layouts, especially at the template level.
Workshop Visualizing CPU Load and Memory Usage
Objective:
To find and view simple graphs for CPU load and memory usage for your "Zabbix server" host, and then create a new Dashboard to display these two graphs side-by-side.
Prerequisites:
- Your Zabbix server is running and monitoring itself (as configured in previous workshops).
- The "Linux by Zabbix agent" template (or a similar one providing CPU and memory items) is linked to your "Zabbix server" host.
- Data for CPU load and memory usage is being collected.
Part 1: View Simple Graphs via Latest Data
- Log in to Zabbix Frontend.
- Navigate to Latest Data:
- Go to Monitoring -> Latest data.
- Filter for your Zabbix Server Host:
- In the "Hosts" filter, select "Zabbix server".
- Click "Apply".
-
Find CPU Load Item:
- In the "Name" filter within the latest data page, type
CPU
to narrow down the list. - Look for an item related to overall CPU load or utilization. A common key from
Linux by Zabbix agent
issystem.cpu.util
(which shows total utilization) or specific items likeCPU utilization
. Another might besystem.cpu.load[percpu,avg1]
(1-minute average load). - For this workshop, let's find an item like
CPU utilization
(this is a single percentage value representing overall CPU usage, oftensystem.cpu.util[,avg1]
). - Once found, click the "Graph" link in its row.
- Observe the graph. Change the time period selector (e.g., to "Last 1 hour", "Last 1 day") to see how the data looks over different durations.
- In the "Name" filter within the latest data page, type
-
Find Memory Usage Item:
- Go back to Monitoring -> Latest data (or just clear the "Name" filter if still there).
- In the "Name" filter, type
Memory
orAvailable memory
. - Look for an item like
Available memory
(keyvm.memory.size[available]
) orMemory utilization
(keyvm.memory.util
). Let's aim forMemory utilization
if available, as it's a percentage. If not,Available memory
is fine. - Once found, click the "Graph" link in its row.
- Observe this graph and play with the time period selector.
Part 2: Create a Custom Dashboard
-
Navigate to Dashboards:
- Go to Monitoring -> Dashboard. You might see the default "Global view" dashboard.
-
Create a New Dashboard:
- Click the "All dashboards" dropdown (or similar button/link to manage dashboards).
- Click "Create dashboard".
- Name:
My Server Performance Overview
- Owner: Should be your user (e.g.,
Admin
). - You can set sharing options if you want others to see it, but for now, private is fine.
- Click "Add". You will be taken to an empty dashboard in edit mode.
-
Add a Widget for CPU Utilization:
- Click "Add widget" (often a "+" button or a prominent link on the empty dashboard).
- Type: Select
Graph
. - Name (Widget Title):
CPU Utilization (%)
- Refresh interval:
1m
(or as desired). - Data set:
- This is where you define what the graph shows. Click "Add" in the "Data set" section.
- Host pattern: Type
Zabbix server
and select it. - Item pattern: Type
CPU utilization
and select the item (e.g.,system.cpu.util[,avg1]
).- (If you can't find
CPU utilization
easily, you can use the item key. Click the pencil/edit icon next to item pattern, then select the specific item after filtering by host.)
- (If you can't find
- Draw style:
Line
- Color: Choose a color (e.g., blue).
- Click the small "Add" button for this data set entry.
- Click the main "Add" button at the bottom of the widget configuration window.
- The CPU graph widget will appear on your dashboard. You can drag it and resize it.
-
Add a Widget for Memory Utilization:
- Click "Add widget" again.
- Type:
Graph
. - Name (Widget Title):
Memory Utilization (%)
- Data set:
- Click "Add" in the "Data set" section.
- Host pattern:
Zabbix server
- Item pattern: Type
Memory utilization
(e.g.,vm.memory.util
) orAvailable memory
(e.g.vm.memory.size[available]
) if percentage utilization is not directly available. If usingAvailable memory
, the Y-axis will be in bytes/KB/MB, not percentage. Let's assumeMemory utilization
is available. - Draw style:
Line
- Color: Choose a different color (e.g., green).
- Click the small "Add" button for this data set entry.
- Click the main "Add" button at the bottom of the widget configuration window.
- The memory graph widget will appear. Resize and arrange it next to the CPU graph.
-
Save the Dashboard:
- Once you've arranged your widgets, click "Save changes" (usually at the top right).
-
View Your New Dashboard:
- Your dashboard
My Server Performance Overview
should now display the two graphs. - You can switch between dashboards using the "All dashboards" dropdown.
- Your dashboard
Exploration (Optional):
- Try adding another widget, for example, "Problems" widget, to see any active issues.
- Edit one of the graph widgets. In its "Data set", try adding another item to the same graph (e.g., if you have items for different CPU states like
system.cpu.util[,user]
andsystem.cpu.util[,system]
, add them both to the CPU widget). - Experiment with different widget types like "Clock" or "System information".
This workshop gives you a practical feel for how to visualize Zabbix data, moving from simple ad-hoc graphs to creating a customized dashboard for ongoing monitoring. This is a key skill for making sense of the metrics Zabbix collects.
5. User Management and Permissions
As your Zabbix deployment grows, or if multiple people need to access it, proper user management and permission control become essential. Zabbix has a flexible system for managing users, grouping them, and assigning granular permissions to control what they can see and do within the Zabbix interface. This ensures that users only have access to the information and configuration settings relevant to their roles, enhancing security and operational integrity.
Understanding User Roles
In Zabbix, access control is primarily managed through User Groups and User Roles (User Roles were introduced more prominently in Zabbix 5.2+ and significantly enhanced how permissions for UI elements and API methods are managed).
Users:
- An individual account that can log in to the Zabbix frontend.
- Each user has a username (alias), password, and can be associated with one or more user groups.
- Users can also have personal settings like language, theme, and default landing page.
User Groups:
- A collection of users.
- Permissions to access host groups (and therefore host data) are assigned at the user group level.
- A user inherits permissions from all groups they are a member of. If multiple groups grant different levels of access to the same host group, the highest permission level usually applies.
- User groups can be enabled or disabled. Disabled groups effectively revoke access for their members without deleting the group configuration.
User Roles (Zabbix 5.2+):
- User Roles define what parts of the Zabbix UI a user can see and what actions they can perform (e.g., acknowledge problems, change configuration, access API methods).
- Each user group is assigned a single User Role.
- Zabbix comes with pre-defined roles:
- User role: Limited access, typically for viewing data and acknowledging problems.
- Admin role: Access to configuration sections, but not Zabbix administration settings.
- Super Admin role: Full access to all Zabbix features, including administration and user management.
- You can create custom roles to define very specific permission sets. For example, a role that can only view dashboards and graphs but cannot acknowledge problems or see configuration.
Permissions Logic Summary:
- A User belongs to one or more User Groups.
- Each User Group is assigned a User Role (which defines UI/API access).
- Each User Group is also granted permissions (Read-write, Read-only, Deny) to specific Host Groups.
This layered approach allows for flexible and granular control. For instance, you can have:
- A "NOC Operators" user group with a "NOC Operator Role" (can view dashboards, graphs, problems, and acknowledge problems) having Read-only access to "Production Servers" host group.
- A "DB Admins" user group with an "Admin Role" (can configure hosts, items, triggers) having Read-write access only to the "Database Servers" host group.
Creating Users and User Groups
Let's walk through the process of creating a new user and a new user group.
Creating a User Group:
- Navigate to User Group Configuration:
- In Zabbix frontend, go to Administration -> User groups.
- Create New Group:
- Click the "Create user group" button.
- Group Tab:
- Group name: Enter a descriptive name (e.g.,
Read-Only Viewers
,Application Team A
). - Frontend access: (Older Zabbix versions) Defines default access to UI sections. In newer versions (5.2+), this is largely superseded/complemented by User Roles.
- Users: You can add existing users to this group here, or add users to the group later when editing the user.
- Group name: Enter a descriptive name (e.g.,
- Permissions Tab (Crucial for host data access):
- This tab defines what host groups the users in this group can access.
- Click "Select" to choose host groups. You can select multiple.
- For each selected host group, a permission level is displayed (e.g., Read-only). Click on the permission level to change it:
- Read-write: Can view data and modify configuration for hosts in this group (if their User Role also allows configuration access).
- Read-only: Can only view data for hosts in this group.
- Deny: Explicitly denies access, even if another group grants it (use with caution).
- None: (Effectively no permission specified by this group for this host group).
- Add the host groups you want this user group to access with the appropriate permission. For example, for a
Read-Only Viewers
group, you might give "Read-only" permission to "Linux servers" and "Windows servers".
- Tag filters Tab (Optional, Zabbix 5.4+):
- Allows filtering data visibility based on tags for users in this group, in addition to host group permissions.
- Assign User Role (Zabbix 5.2+):
- Go back to the "User group" tab (or a dedicated "User Role" tab if present in your Zabbix version for group config).
- Select the appropriate User Role from the dropdown (e.g.,
User role
for read-only access,Admin role
for configuration).
- Add/Update Group:
- Click "Add" (if new) or "Update" (if editing).
Creating a User:
- Navigate to User Configuration:
- Go to Administration -> Users.
- Create New User:
- Click the "Create user" button.
- User Tab:
- Alias: The username for login (e.g.,
jdoe
,viewer01
). - Name / Surname: Optional, for informational purposes.
- Groups: Click "Select" and choose the user group(s) this user should belong to (e.g., the
Read-Only Viewers
group you just created). A user can be in multiple groups. - Password: Set an initial password for the user.
- Password (twice): Confirm the password.
- Language / Theme / Timezone / Rows per page / Refresh: User-specific preferences.
- URL (after login): (Optional) A specific URL within Zabbix to redirect the user to after login.
- Alias: The username for login (e.g.,
- Permissions Tab:
- User type: This is legacy in newer Zabbix versions. The effective permissions are now determined by the User Role assigned to the User Groups the user is part of.
- In older Zabbix versions, you'd set Zabbix User, Zabbix Admin, or Zabbix Super Admin here directly.
- In Zabbix 5.2+, the primary control for UI sections and actions comes from the User Role of their group. The "User type" here might still exist for backward compatibility or simpler setups but the Role is dominant. Default is
Zabbix User
. For a Super Admin, you'd still chooseZabbix Super Admin
here as it's a special type.
- User type: This is legacy in newer Zabbix versions. The effective permissions are now determined by the User Role assigned to the User Groups the user is part of.
- Media Tab:
- This is where you configure notification methods for this user (e.g., email address). Covered in more detail in the "Alerting and Notifications" section.
- Add/Update User:
- Click "Add" (if new) or "Update" (if editing).
The new user can now log in with the alias and password you set and will have the permissions granted through their user group(s) and associated user role(s).
Assigning Permissions to Host Groups
As seen above, the core of data access permission is linking User Groups to Host Groups with a specific permission level (Read-write, Read-only, Deny).
Let's reiterate the process and its importance:
-
Identify Roles and Responsibilities:
- Who needs access to Zabbix?
- What do they need to do? (View only? Acknowledge alerts? Configure new hosts?)
- What specific systems/applications are they responsible for?
-
Create Logical Host Groups:
- Organize your hosts into meaningful groups (e.g.,
Web Servers Prod
,Web Servers Dev
,Databases Oracle
,Databases MySQL
,Network Core
,Network Edge
).
- Organize your hosts into meaningful groups (e.g.,
-
Create User Groups and Assign User Roles:
- For each distinct role/responsibility, create a User Group (e.g.,
Web Admins
,DBA Team
,NOC Level 1
). - Assign an appropriate User Role to each User Group (e.g.,
Web Admins
might getAdmin role
,NOC Level 1
might get a customNOC Operator role
).
- For each distinct role/responsibility, create a User Group (e.g.,
-
Grant Permissions:
- Edit each User Group.
- Go to the "Permissions" tab.
- Add the Host Groups relevant to this User Group with the necessary permission level.
- Example:
Web Admins
group gets "Read-write" access toWeb Servers Prod
andWeb Servers Dev
. - Example:
DBA Team
group gets "Read-write" access toDatabases Oracle
andDatabases MySQL
. - Example:
NOC Level 1
group gets "Read-only" access to all production host groups.
- Example:
Best Practices for Permissions:
- Principle of Least Privilege: Grant only the necessary permissions required for a user/group to perform their duties. Avoid giving Super Admin access unless absolutely necessary.
- Use Groups: Always assign permissions to groups, not individual users (though Zabbix model enforces this for host group permissions). Add users to groups. This simplifies management.
- Descriptive Naming: Use clear names for user groups, host groups, and custom user roles.
- Regular Review: Periodically review user accounts and their permissions, especially when personnel change roles or leave the organization.
- Test Permissions: After setting up a new user/group, log in as that user (or a test user in that group) to verify they have the correct access and restrictions.
Media Types and Notifications (Brief Introduction)
While full details on alerting are covered in an intermediate section, it's relevant to user management because notifications are sent to users via their configured Media Types.
-
Media Types: These are the different channels Zabbix can use to send notifications (e.g., Email, SMS, Slack, PagerDuty, custom alertscripts).
- Global media types are configured under Administration -> Media types.
- You define settings like SMTP server for email, API tokens for services like Slack, etc.
-
User Media: For each user, you can configure their specific "media."
- In Administration -> Users -> [User] -> Media tab, click "Add".
- Type: Select a globally defined Media Type (e.g., "Email").
- Send to: Enter the user's specific address/identifier for that media type (e.g., their email address like
user@example.com
). - When active: Define time periods when this media should be used for notifications (e.g.,
1-7,00:00-24:00
for always, or specify business hours). - Use if severity: Select which trigger severities should use this media for this user (e.g., only send emails for Average, High, and Disaster).
- Enabled: Check to activate this media for the user.
When an Action is configured to send a notification, it will look at the target user(s) or user group(s) and use their configured, active, and severity-matching media to deliver the message.
This brief introduction shows how user-specific contact details are linked to the broader notification system.
Workshop Setting Up a Read-Only User
Objective: To create a new Zabbix user who has read-only access to a specific group of hosts (e.g., "Linux servers") and can only view data, not make configuration changes.
Prerequisites:
- Your Zabbix server is running.
- You are logged in as a Zabbix Super Admin (e.g., the default
Admin
user). - You have at least one host group configured with hosts in it (e.g., "Linux servers" containing your "Zabbix server" host).
Steps:
-
Create a New User Role (Optional but good practice for fine-grained control - if your Zabbix version supports robust role customization, e.g., 6.0+):
- If you want very specific UI restrictions, a custom role is best. If the default "User role" is sufficient (typically allows viewing data and acknowledging problems), you can skip to step 2 and use the default "User role".
- Let's assume we'll use the default "User role" for simplicity in this basic workshop. It generally restricts configuration changes.
-
Create a New User Group:
- Go to Administration -> User groups.
- Click "Create user group".
- User group Tab:
- Group name:
Limited Viewers
- Group name:
- Permissions Tab:
- Click "Select" next to the host group list.
- Find and select the "Linux servers" host group (or any other host group you want this group to see). Click "Select" in the pop-up to add it.
- By default, the permission for the added host group might be "Read-only". If not, click on it and change it to "Read-only".
- User Role (or Frontend access on older Zabbix):
- Back on the "User group" tab (or a dedicated "User Role" tab), select the role. For a read-only user who should not configure anything, the built-in
User role
is typically appropriate. - (If your Zabbix is older and uses "Frontend access" directly on the group, set it to "Internal" or "System default" ensuring no admin rights are implicitly given, and rely on the host group Read-only permission).
- Back on the "User group" tab (or a dedicated "User Role" tab), select the role. For a read-only user who should not configure anything, the built-in
- Click "Add".
-
Create a New User:
- Go to Administration -> Users.
- Click "Create user".
- User Tab:
- Alias:
readonly_user
- Name:
Read
(Optional) - Surname:
Only
(Optional) - Groups: Click "Select", find and choose the
Limited Viewers
group you just created. Click the group name to move it to the "User groups" side, then click the main "Select" button at the bottom of the pop-up. - Password: Enter a password (e.g.,
PasswordR0nly!
). - Password (twice): Confirm the password.
- Other settings (Language, Theme, etc.) can be left as default or customized.
- Alias:
- Permissions Tab:
- User type: Ensure it's set to
Zabbix User
. (This, in conjunction with theUser role
assigned to their group, defines their capabilities).
- User type: Ensure it's set to
- Media Tab (Optional for this workshop, but good to see):
- If you wanted this user to receive email alerts:
- Click "Add".
- Type:
Email
(assuming Email media type is configured globally). - Send to:
readonly_user@example.com
(a placeholder, or a real email if testing notifications). - Use if severity: Check desired severities (e.g., Warning, Average, High, Disaster).
- Enabled: Checked.
- Click the small "Add" button for the media entry.
- If you wanted this user to receive email alerts:
- Click the main "Add" button at the bottom to create the user.
-
Test the New User Account:
- Log out of your current Zabbix Super Admin session.
- Log in with the new user:
- Alias:
readonly_user
- Password:
PasswordR0nly!
(or whatever you set)
- Alias:
- Verification Checks:
- Dashboard: The user should be able to see dashboards.
- Monitoring -> Hosts:
- They should only see hosts belonging to the "Linux servers" group (or whichever group you granted read-only access to). If "Linux servers" was the only group permissioned, they won't see hosts from other groups.
- They should be able to view Latest Data and Graphs for these hosts.
- Configuration Menu:
- Try navigating to Configuration -> Hosts. The
readonly_user
(with theUser role
) should not see "Create host" button or be able to edit existing hosts. They might see the list of hosts they have read access to, but configuration options should be disabled or hidden. - Try navigating to Configuration -> Templates. They should not be able to create or edit templates.
- Try navigating to Configuration -> Hosts. The
- Administration Menu:
- Access to most sub-sections under Administration (like User groups, Users, General settings) should be denied or hidden. They might see "Audit" or their own "User profile".
- Problem Acknowledgement: Depending on the exact permissions of the
User role
in your Zabbix version, they might be able to acknowledge problems (this is often allowed for non-admin roles). Try going to Monitoring -> Problems. If a problem exists for a host they can see, check if they can acknowledge it.
This workshop demonstrates how to create a user with restricted privileges, which is a fundamental security and operational practice in any multi-user system, including Zabbix. You've learned to control not only what data they see (via host group permissions) but also what actions they can perform (via user roles).