How to Create a Custom Zabbix Template for Monitoring Processes
Creating a custom Zabbix template is essential for effective server monitoring. By monitoring specific parameters like CPU usage, memory consumption, and the number of processes, you can proactively manage your infrastructure. This guide will walk you through the process of creating a Zabbix template for monitoring key system resources, setting triggers, and configuring host templates.

Step 1: Create a New Zabbix Template
To start, navigate to Configuration > Templates > Create Template. In the template creation interface, you’ll need to define the following:
- Template Name: Choose a clear and descriptive name.
- Group: Select or create a template group.
- Description: Add a brief description for clarity.
Once the template is created, you can begin adding specific monitoring parameters. For example, we’ll monitor CPU usage, memory consumption, and the number of running processes.
Step 2: Add Macros for Customization
Macros allow for flexibility by providing placeholders that can be redefined in host configurations. Here are the macros we’ll use to monitor the critical parameters:
- {$PROC_CPU_MAX}: CPU usage threshold (e.g., 70%)
- {$PROC_MEM_MAX}: Maximum memory usage (e.g., 2 GB)
- {$PROC_COUNT_MIN}: Minimum number of processes (e.g., 1)
- {$PROC_NAME}: The process name (e.g., apache2)
- {$PROC_CPU_NORM}: Normal CPU usage (e.g., 10%)
- {$PROC_MEM_NORM}: Normal memory usage (e.g., 1 GB)
These macros set the following thresholds:
- CPU max usage: 70%
- Memory max usage: 2 GB
- Process name: apache2
- Minimum process count: 1
By defining normal values for CPU and memory, we ensure there’s a clear distinction between normal and problematic states, helping prevent unnecessary alerts.
Step 3: Add Items for Data Collection
To collect relevant data, navigate to the Items section of the template and create the following:
- Number of Processes: Monitors how many processes are running.
- CPU Usage: Tracks CPU utilization.
- Memory Usage: Monitors memory consumption.
These items will continuously collect data, providing real-time insights into your system’s performance.
Step 4: Set Triggers with Hysteresis
Triggers are essential for alerting when thresholds are breached. However, without proper configuration, triggers can cause excessive flapping, firing and recovering too quickly. To avoid this, we’ll set up triggers with hysteresis.
Here’s how to define a trigger for memory usage:
- Trigger Expression: The trigger will fire when memory usage exceeds the defined threshold (3 times in a row).
#{Linux process monitoring:proc.mem[{$PROC_NAME}].count(#3,{$PROC_MEM_MAX},gt)}>=3
This expression ensures that the trigger only fires when memory usage exceeds the set threshold three times consecutively. To prevent flapping, add a recovery condition using normal values:
#{Linux process monitoring:proc.mem[{$PROC_NAME}].count(#3,{$PROC_MEM_NORM},le)}>=3
By applying similar logic to CPU and process monitoring, you can establish stable thresholds for alerts:
- CPU Usage Trigger:
{Linux process monitoring:proc.cpu.util[{$PROC_NAME}].count(#3,{$PROC_CPU_MAX},gt)>=3} - Process Count Trigger:
{Linux process monitoring:proc.num[{$PROC_NAME}].count(#3,{$PROC_COUNT_MIN},lt)}>=3
These expressions ensure that your monitoring system only triggers alerts when consistent issues occur, preventing unnecessary disruptions.
Step 5: Configure the Host Template
Now that the template is ready, you need to link it to the host you want to monitor. To do this:
- Go to Configuration > Hosts.
- Select the target server.
- Under the Templates tab, add your newly created template.
This action applies the template’s monitoring and alerting settings to the selected server, providing comprehensive oversight.
How ZippyOPS Can Enhance Your DevOps Monitoring
While configuring Zabbix templates is crucial for server monitoring, ZippyOPS can take your monitoring setup even further. ZippyOPS provides expert consulting and implementation services for DevOps, Cloud, AIOps, and MLOps, ensuring you get the most out of your infrastructure monitoring tools.
ZippyOPS offers solutions for:
- DevOps & DevSecOps: Seamlessly integrate security and operations.
- Cloud & Infrastructure Management: Optimize your cloud environments for efficiency.
- Automated Operations (AIOps): Leverage automation to resolve issues faster.
To learn more, explore ZippyOPS Services or dive into our solutions for tailored infrastructure solutions. You can also check out our YouTube channel for expert insights.
Conclusion: Efficient Monitoring with Zabbix Template
Creating custom Zabbix templates for process monitoring is a powerful way to keep your infrastructure running smoothly. By setting clear thresholds for CPU, memory, and process counts, and using triggers with hysteresis, you can minimize false alerts and ensure reliable monitoring.
If you need assistance in optimizing your monitoring setup, or wish to integrate advanced DevOps practices, ZippyOPS is here to help. Reach out to us today at sales@zippyops.com.



