Operations 23 min read

Unlock Zabbix Monitoring: Complete Setup, Custom Alerts & Distributed Management

Zabbix offers a web‑based, enterprise‑grade solution for distributed system and network monitoring; this guide walks Linux ops engineers through why monitoring matters, key availability metrics, what to monitor, step‑by‑step installation, web UI configuration, custom checks, alerting, visualization, template sharing, full‑network scaling, auto‑discovery, proxy deployment, and SNMP integration.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Unlock Zabbix Monitoring: Complete Setup, Custom Alerts & Distributed Management

1. Zabbix Monitoring Overview

Zabbix is a web‑based, open‑source enterprise solution for distributed system and network monitoring, widely used in enterprises.

1.1 Why Monitor

Monitoring provides early alerts when servers encounter problems, helps locate root causes, and ensures website/server availability.

1.1.1 Website Availability

High Availability (HA) is often expressed as "X nines" (e.g., 99.9% uptime). The article explains the downtime associated with 1‑9 through 6‑9 levels.

1.2 What to Monitor

Anything that can be queried via command line can be monitored: hardware temperature, fan speed, CPU load, memory, disk usage, network traffic, services, etc.

1.3 How to Monitor

Remote management cards (Dell iDRAC, HP iLO, IBM IMM) for servers, ipmitool for hardware, lscpu, uptime, top, htop, vmstat, mpstat for CPU, free for memory, df, dd, iotop for disks, and iftop, nethogs for network.

1.4 Monitoring Tools Overview

MRTG – traffic monitoring with graphs

Nagios – general monitoring

Cacti – traffic monitoring with graphs

Zabbix – monitoring + graphing

1.5 Zabbix Introduction

Zabbix, developed by Alexei Vladishev, follows a server‑client architecture. It stores data in MySQL, PostgreSQL, SQLite, Oracle, or IBM DB2. The server is written in C; the web frontend uses PHP. Monitoring can be performed via simple checks, SNMP, TCP, ICMP, IPMI, SSH, Telnet, etc., and supports XMPP notifications.

2. Installation of Zabbix

2.1 Environment Check

Verify OS version, required packages, and network connectivity before proceeding.

2.2 Installation Methods

Compile from source (for complex environments)

YUM installation (clean environment)

2.3 Quick Server Installation Script

# yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent

2.4 Client Quick Deployment Script

# yum install -y zabbix-agent

2.5 Connectivity Test

# yum install -y zabbix-get
# zabbix-get -s 172.16.1.51 -p 10050 -k "net.tcp.port[,3306]"

3. Web Interface Operations

3.1 Zabbix Web Installation

Access http:// /zabbix/setup.php in a browser, follow the wizard, select MySQL, provide DB credentials, and finish the installation.

3.2 Adding Hosts

Navigate to Configuration → Hosts → Create host , set host name, visible name, assign to groups, and enable the host.

3.3 Viewing Data and Graphs

Use Monitoring → Latest data to view item values and Monitoring → Graphs to see visualizations.

4. Custom Monitoring and Alerts

4.1 Custom Monitoring

The built‑in template Template OS Linux (Template App Zabbix Agent) already monitors CPU, memory, disk, and network interfaces. Custom requirements (e.g., limit login users to three) can be implemented via user‑defined items, triggers, and actions.

4.2 Creating Custom Items

# UserParameter=login-users,who | wc -l

4.3 Creating Triggers

Define a trigger expression such as {Host:login-users.last()}>3 with appropriate severity.

4.4 Creating Graphs

Link the custom item to a new graph for visual monitoring.

4.5 Alert Media and Third‑Party Platforms

Integrate with services like OneAlert for SMS, WeChat, QQ, and email notifications.

4.6 Visualization

Use aggregated graphs, slideshows, and dashboards to present monitoring data.

4.7 Template Sharing

Export hosts or templates via the UI and import them on other Zabbix servers.

5. Full‑Network Monitoring

5.1 Requirements

Monitor 100 servers for CPU, memory, disk, and network; automate host addition via cloning, auto‑registration, auto‑discovery, or API calls.

5.2 Monitoring Specific Services

Backup servers – monitor rsync port 873

NFS servers – monitor RPC port 111 or showmount -e MySQL – monitor port 3306 or use Zabbix MySQL template

Web servers – monitor HTTP port 80 and URL health checks

Reverse proxy, PPTP, NTP – monitor respective ports

Nginx – monitor the seven connection states via custom keys

5.3 Implementation Examples

Use net.tcp.port[<ip>,<port>], proc.num[<name>], or custom scripts executed via zabbix_get for verification.

6. Auto‑Discovery and Auto‑Registration

6.1 Concepts

Auto‑discovery: Zabbix server actively scans the network and registers hosts. Auto‑registration: Zabbix agents push their presence to the server.

6.2 Passive Auto‑Discovery

Configure discovery rules under Configuration → Discovery , set IP range, delay, and create discovery actions to add hosts, enable them, and link templates.

6.3 Active Auto‑Registration

Set ServerActive=172.16.1.61 in zabbix_agentd.conf, restart the agent, and create an action with event source "Auto registration" to add the host, assign groups, and link templates.

7. Distributed Monitoring and SNMP

7.1 Distributed Monitoring

Deploy Zabbix proxies to offload load from the central server and to monitor remote data centers. Proxies store data locally in a MySQL database and forward it to the server.

7.2 SNMP Monitoring

Install net-snmp and net-snmp-utils, enable the systemview in /etc/snmp/snmpd.conf, and test with snmpwalk -v 2c -c public 127.0.0.1 sysName. In the Zabbix UI, create a host using the SNMP interface and apply an SNMP template.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Distributed SystemsAutomationAlertinglinuxZabbixSNMP
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.