Operations 5 min read

How to Set Up Custom Nginx Monitoring and Triggers in Zabbix 7.2

This guide walks you through installing the zabbix-get service, deploying and starting Nginx, creating a Bash script for status checks, adding a custom UserParameter, validating the items on the Zabbix server, and configuring UI items and triggers to monitor Nginx health.

Raymond Ops
Raymond Ops
Raymond Ops
How to Set Up Custom Nginx Monitoring and Triggers in Zabbix 7.2

zabbix7.2 latest version nginx custom monitoring – set trigger

Install zabbix-get service

dnf install -y zabbix-get

Install and start Nginx

dnf install -y nginx
systemctl restart nginx
netstat -pltun

Nginx monitoring script

#!/bin/bash
if pgrep -x "nginx" > /dev/null
then
  echo 0
else
  echo 1
fi

Add custom key configuration

UserParameter=nginx_status,/bin/bash /etc/zabbix/zabbix_agentd.d/nginx_status.sh

Validate on Zabbix server

zabbix_get -s 192.168.25.152 -k agent.ping
zabbix_get -s 192.168.25.152 -k nginx.status

Create Nginx monitoring item in UI

UI creation of Nginx monitoring item
UI creation of Nginx monitoring item

Set Nginx trigger

Nginx trigger configuration
Nginx trigger configuration

Stop Nginx to see monitoring change

systemctl stop nginx
netstat -pltun
Monitoring after Nginx stopped
Monitoring after Nginx stopped

Start Nginx to restore normal state

systemctl start nginx
Monitoring after Nginx started
Monitoring after Nginx started
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.

AutomationLinuxZabbix
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

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.