zabbix自定義監控nginx狀態實現過程

2022-09-21 04:42:07 字數 1500 閱讀 5651

目錄

www.cppcns.com

zabbufztafeiix_server

192.168.200.145

zabbix_agentd ,nginx

192.168.200.146

開啟status:

[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf

location /status

[root@localhost ~]# nginx -s reload

狀態頁面資訊詳解:

狀態碼表示的意義

active connections 2

當前所有處於開啟狀態的連線

accepts

總共處理了多少個連線

handled

成功建立多少握手

requests

總共處理了多少個請求

reading

nginx讀取到客戶端的header資訊數,表示正處於接收請求狀態的連線數

writing

nginx返回給客戶端的header資訊數,表示請求已經接收完成,且正處於處理請求或傳送響應的過程中的連線數

waiting

開啟keep-alive的情況下,這個值等於active - (reading + writing),意思就是nginx已處理完正在等候下一次請求指令的駐留連線

//新增配置檔案

[root@localhost scripts]# vim /usr/local/etc/zabbix_agentd.conf

unsafeus程式設計客棧erparameters=1

userparameter=check_status[*],/bin/bash /scripts/check_reading.sh $1

[root@localhost scripts]# pkill zabbix_agentd

[root@localhost scripts]# zabbix_agentd

//測試

[root@zabbix ~]# zabbix_get -s 192.168.200.146 -k check_status waiting

1[root@localhost scripts]# ab -n 1500000

zabbix自定義監控

1 監控資料備份情況 主動模式 1 資料備份及傳送成功 1 2 資料匯入成功 1 2 在zabbix agent客戶端配置如下 root zagent zabbix cat etc zabbix zabbix agentd.conf startagents 0 設定該值為0,則agent不會監聽本地...

zabbix監控之自定義監控

自定義監控node1資料庫狀態,並設定報警 編輯agent客戶端的userparameter mysql.conf 檔案,最後一行新增自定義監控內容 root node1 cd etc zabbix zabbix agentd.d root node1 zabbix agentd.d lsuserp...

Zabbix 自定義監控項

vi usr local zabbix etc zabbix agentd.conf unsafeuserparameters 1 userparameter check process,echo top b n 1 grep mysqld awk f server 192.168.1.12 然後r...