Operations 8 min read

Using Zabbix to Monitor Service Ports and Configure Email Alerts

This article explains how to use Zabbix for simple service‑port monitoring, covering installation, host and item creation, trigger and graph setup, and email notification configuration, providing a practical guide for developers who need lightweight operational monitoring without writing custom code.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Using Zabbix to Monitor Service Ports and Configure Email Alerts

Backend and server development often require many services to be monitored and maintained, and when operations resources are limited developers may need to handle monitoring themselves.

Background – Traditionally developers add email alerts to each service, but this approach leads to duplicated effort, especially in distributed systems, and may require third‑party services. The author considered building a custom monitoring module but found Zabbix, a powerful open‑source monitoring tool, to be a more efficient solution.

Zabbix Overview – Zabbix consists of a front‑end UI, a server, and a database, typically deployed via Docker. The UI shows a two‑level menu with five main functional modules.

Monitoring Modes – Zabbix offers two common modes: (1) active server‑initiated checks (simple but limited to basic data such as port status) and (2) agent‑based monitoring (comprehensive, requiring Zabbix agents on target hosts). This guide uses the first, simpler mode.

Step 1: Create Host – In the Zabbix UI, add a new host representing the service to be monitored.

Step 2: Create Monitoring Item – Within the host, create an item to monitor port 9998, selecting the simple check type and configuring key, update interval, etc.

Step 3: Create Trigger – Define a trigger expression that fires when the item returns 0, indicating the port is down.

Triggered alerts appear under the top‑level "Monitoring" → "Problems" menu.

Step 4: Create Graph – Generate a graph for the monitoring item to visualize port status.

Graphs are displayed under "Monitoring" → "Graphs".

Grafana can use Zabbix as a data source for richer dashboards.

Email Notification Configuration – To receive alerts via email, first configure an email media type, then create a user with appropriate read permissions on the host group, and finally set up an action that sends an email when the trigger fires.

Ensure the user has host read permissions; otherwise, no email will be sent. Permissions can be granted by assigning the user as a super‑admin or by adding the user to a group with read access to the relevant host group.

Finally, create an action that links the trigger to the email operation, being careful to configure recovery and update operations appropriately to avoid excessive notifications.

Conclusion – By leveraging Zabbix, developers can quickly set up service‑port monitoring and email alerts without writing custom monitoring code, providing a lightweight yet effective operational solution.

monitoringoperationsalertingEmail NotificationZabbixService Port
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login 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.