发布时间: 2023-12-18 文章作者: myluzh 分类名称: Zabbix 朗读文章
宏 | 值 | 描述 |
{$NGINX.PROCESS_NAME} |
nginx |
|
{$NGINX.STUB_STATUS.HOST} |
127.0.0.1 |
|
{$NGINX.STUB_STATUS.PATH} |
basic_status |
|
{$NGINX.STUB_STATUS.PORT} |
80 |
|
root@nginx:/etc/nginx/conf.d# nginx -V 2>&1 | grep -o with-http_stub_status_module with-http_stub_status_module2、nginx配置文件
root@nginx:/etc/nginx/conf.d# cat status.conf server { listen 80; server_name 127.0.0.1; location /basic_status { stub_status on; #access_log off; } }3、测试
# curl测试下
root@nginx:/etc/nginx/conf.d# curl http://127.0.0.1:80/basic_status
Active connections: 1
server accepts handled requests
278459659 278458481 279256404
Reading: 0 Writing: 1 Waiting: 0
# 或者看下nginx的access日志
root@nginx:~# tail -f -n 2000 /var/log/nginx/access.log | grep basic_status
127.0.0.1 - - [18/Dec/2023:14:03:12 +0800] "GET /basic_status HTTP/1.1" 200 121 "-" "Zabbix 6.2.9"
标签: zabbix nginx nginx_agent
发表评论