Zabbix monitoring Nginx

Source: Internet
Author: User

Edit nginx.conf File

Add content inside the server

Location/nginx-status {

Stub_status on;

Access_log off;


2.zabbix AGENTD Client Configuration


Add the following at the end of the file


Userparameter=nginx.accepts,/usr/local/zabbix/scripts/ accepts

Userparameter=nginx.handled,/usr/local/zabbix/scripts/ handled

userparameter=nginx.requests,/usr/local/zabbix/scripts/ Requests,/usr/local/zabbix/scripts/ Active

userparameter=nginx.connections.reading,/usr/local/zabbix/scripts/ Reading

userparameter=nginx.connections.writing,/usr/local/zabbix/scripts/ Writing

Userparameter=nginx.connections.waiting,/usr/local/zabbix/scripts/ Waiting

3. Edit the file



host= (If you write a domain name under each domain name)


# Functions to return nginx stats

Function Active {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | grep ' Active ' | awk ' {print $NF} '


function reading {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | grep ' Reading ' | awk ' {print $} '


function writing {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | grep ' Writing ' | awk ' {print $4} '


function waiting {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | grep ' Waiting ' | awk ' {print $6} '


function accepts {

/usr/bin/curl "/http $HOST: $PORT/nginx-status" 2>/dev/null | awk nr==3 | awk ' {print '} '


function handled {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | awk nr==3 | awk ' {print $} '


function requests {

/usr/bin/curl "/http $HOST/nginx-status" 2>/dev/null | awk nr==3 | awk ' {print $} '



chmod +x/usr/local/zabbix/scripts/

4. Restart Zabbix_agentd

Service Zabbix_agentd Restart

5.zabbixweb Control-Side Import Template

6.zabbix Monitoring Client Add Nginx module

This article is from the "System website Operations" blog, please be sure to keep this source

Zabbix monitoring Nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.