nginx开启status

./configure --with-http_stub_status_module

nginx.conf
location /statusx35 {
stub_status on;
}

http://127.0.0.1/statusx35

Active connections:
server accepts handled requests Reading: Writing: Waiting:

nginx status状态值详解

Active connections: 活跃的连接次数

server accepts handled requests: 一共处理的连接次数,成功创建的握手次数,一共处理的请求次数

Reading: 读取客户端的连接数

Writing: 响应数据到客户端的数量

Waiting: 开启 keep-alive 的情况下,这个值等于 active C (reading+writing),意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接。

定义zabbix监控item key

  vim etc/zabbix_agentd.conf.d/userparameter_nginx.conf

UserParameter=nginx.status[*],/storage/server/zabbix-agent/scripts/nginx_status.sh $

nginx_status.sh

#!/bin/bash
# // pdd HOST=127.0.0.1
PORT=
URI="/statusx35" case "$1" in
Active_connections)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==1 {print $3}'
;;
server_accepts)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==3 {print $1}'
;;
server_handled)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==3 {print $2}'
;;
server_requests)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==3 {print $3}'
;;
Reading)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==4 {print $2}'
;;
Writing)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==4 {print $4}'
;;
Waiting)
curl -s -m --no-keepalive "http://${HOST}:${PORT}${URI}" | awk 'NR==4 {print $6}'
;;
*)
echo "Usage: $0 Active_connections|server_accepts|server_handled|server_requests|Reading|Writing|Waiting"
esac

重启zabbix_agentd使监控key生效

客户端测试

服务器端 # 页面监控主机添加对应的application items

创建Graphs(nginx status)

zabbix后台 Configuration->Hosts->被监控的主机name->Graphs

查看graph(nginx status)

zabbix后台 Monitoring->Graphs->对应的graph

Zabbix监控nginx status的更多相关文章

  1. zabbix监控nginx status页面

    在需要添加监控的nginx配置文件中添加下列配置 #zabbix监控nginx配置 location /nginx_status { stub_status on; access_log off; a ...

  2. Zabbix 监控 Nginx(四)

    简介: 如何使用 Zabbix 监控 Nginx 状态 ? 1.获取 Nginx 状态( HTTP Stub Status ) [root@localhost ~]# /apps/product/ng ...

  3. Zabbix 监控 Nginx 状态

    简介: 如何使用 Zabbix 监控 Nginx 状态 ? 1.获取 Nginx 状态( HTTP Stub Status ) shell > /usr/local/nginx/sbin/ngi ...

  4. zabbix监控nginx

     nginx status详解 active connections – 活跃的连接数量server accepts handled requests — 总共处理了11989个连接 , 成功创建11 ...

  5. 使用zabbix监控nginx

    在zabbix agentd客户端上,查看nginx是否加载了--with-http_stub_status_module.因为zabbix监控nginx是根据 nginx的Stub Status模块 ...

  6. zabbix监控nginx连接状态(转)

    zabbix监控nginx zabbix可以监控nginx的状态,关于一个服务的状态可以查看服务本身的状态(版本号.是否开启),还应该关注服务能力(例如以nginx的负载效果:连接数.请求数和句柄数) ...

  7. 使用zabbix监控nginx的活动连接数

    使用zabbix监控nginx的活动连接数 1.方法简述 zabbix可以自定义很多监控,只要是能通过命令获取到相关的值,就可以在zabbix的监控中增加该对象进行监控,在zabbix中,该对象称之为 ...

  8. Zabbix监控nginx性能的另外一种方式

    Zabbix监控nginx性能的另外一种方式 nginx和php-fpm一样内建了一个状态页,对于想了解nginx的状态以及监控nginx非常有用,为了后续的zabbix监控,我们需要先启用nginx ...

  9. Zabbix应用四:Zabbix监控Nginx

    利用Zabbix监控Nginx 一.准备nginx监控模版: 1.1.下载nginx监控模版:  点此下载 1.2.导入模版: Zabbix管理页面,选择'配置'->'模版'->'导入': ...

随机推荐

  1. 敏捷开发与jira之流程

    敏捷流程在Jira中的运用

  2. org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

    org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a ...

  3. ASP.NET获取真正的客户端IP地址的6种方法

    Request.ServerVariables("REMOTE_ADDR") 来取得客户端的IP地址,但如果客户端是使用代理服务器来访问,那取到的就是代理服务器的IP地址,而不是真 ...

  4. 阿里云centos安装svn和submin

    概述 没有找到可以让团队方便使用的云盘,暂时搭建一个svn凑合用一下 svn有三种安装方式 安装方式 服务程序 服务协议 用户和密码 授权 系统配置 svn独立安装 svnserve svn pass ...

  5. Java 流(Stream)、文件(File)和IO

    Java.io包几乎包含了所有操作输入.输出需要的类.所有这些流类代表了输入源和输出目标. Java.io包中的流支持很多种格式,比如:基本类型.对象.本地化字符集等等. 一个流可以理解为一个数据的序 ...

  6. W3School-CSS 外边距 (margin) 实例

    CSS 外边距 (margin) 实例 CSS 实例 CSS 背景实例 CSS 文本实例 CSS 字体(font)实例 CSS 边框(border)实例 CSS 外边距 (margin) 实例 CSS ...

  7. PHP的openssl加密扩展使用小结

    h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h ...

  8. Mac OS X常用操作入门指南

    前两天入手一个Macbook air,在装软件过程中摸索了一些基本操作,现就常用操作进行总结, 1关于触控板: 按下(不区分左右)            =鼠标左键 control+按下        ...

  9. SSL handshake alert: unrecognized_name error since upgrade to Java 1.7

    今天将jdk从1.6升级到1.7,但是HttpUrlConnection连接https出现问题了. javax.net.ssl.SSLProtocolException: handshake aler ...

  10. MariaDB的GTID复制和多源复制

    什么是GTID? GTID就是全局事务ID(global transaction identifier ),最初由google实现,官方MySQL在5.6才加入该功能.GTID实际上是由UUID+TI ...