Zabbix custom monitoring nginx status
1. Open the status interfaceEnable status: [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf location /status { stub_status on; allow 192.168.200.146; allow 192.168.200.145 deny all; } [root@localhost ~]# nginx -s reload Status page information details:
2. Write monitoring scripts[root@localhost scripts]# vim check_status.sh #!/bin/bash ip=$(ip a | grep 'inet ' | grep -v '127.0.0.1' | awk -F'[ /]+' '{print $3}') case $1 in "Reading") curl -s http://$ip | awk 'NR==4 {print $2}';; "Writing") curl -s http://$ip | awk 'NR==4 {print $4}';; "Waiting") curl -s http://$ip | awk 'NR==4 {print $6}' esac //Add configuration file [root@localhost scripts]# vim /usr/local/etc/zabbix_agentd.conf UnsafeUserParameters=1 UserParameter=check_status[*],/bin/bash /scripts/check_Reading.sh $1 [root@localhost scripts]# pkill zabbix_agentd [root@localhost scripts]# zabbix_agentd //Test[root@zabbix ~]# zabbix_get -s 192.168.200.146 -k check_status Waiting 1 3. Configure monitoring items4. Configure triggers5. Testing[root@localhost scripts]# ab -n 1500000 http://192.168.200.146/status The above is the detailed content of the implementation process of Zabbix custom monitoring nginx status. For more information about Zabbix custom monitoring nginx, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Common styles of CSS animation effects animation
>>: Why does using limit in MySQL affect performance?
Introduction MySQL 5.7 aims to be the most secure...
Table of contents Preface: 1.Brief introduction t...
question The tomcat container was successfully ad...
Here is a case study on how to close ads using Ja...
Table of contents Class Component Functional Comp...
Table of contents Preface Main implementation cod...
Table of contents 1. Create objects by literal va...
This article example shares the specific code of ...
When using the font-family property in CSS to ref...
Table of contents For example: General writing: S...
Table of contents 1. Delete the old version 2. Ch...
1. Problem symptoms Version: MySQL 5.6, using the...
Preface This article mainly explains how to imple...
Table of contents Preface Rationale Procedure 1. ...
Table of contents Tutorial Series 1. Install Mari...