背景: 购物车相关的站点某些页面经常出现502,如果超过一些阈值则需要报警给管理员知道 .自动发现脚本的编写 # vim /usr/local/zabbix_agents_3.2.0/scripts/store_nginx_code.sh #!/bin/bash # function:monitor store nginx access error code store_domain_discovery () { WEB_DOMAIN=($(cat /usr/local/zabbix_agent…
1.前言 今天在处理一个客户问题,遇到Nginx access log中出现大量的499状态码.实际场景是:客户的域名通过cname解析到我们的Nginx反向代理集群上来,客户的Web服务是由一个负载均衡提供外网IP进行访问,负载均衡后面挂了多个内网web站点业务服务器.出现的访问日志如下所示: 2.处理方法 499错误是什么?让我们看看NGINX的源码中的定义: ngx_string(ngx_http_error_495_page), /* 495, https certificate err…
为了将本机(windows系统)启动的应用以HTTPS的形式访问, 利用Keytool 生成证书之后.在tomcat的server.xml中将配置修改为如下: <Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" client…
##在使用chromedriver的时候 并没有提供api来获取访问页面的状态码,但是可以打开日志来获取到 LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); DesiredCapabilities cap = DesiredCapabilities.chrome(); cap.setCapability(CapabilityType.LO…
本篇是基于zabbix 源码安装的 [root@localhost conf]# curl "http://192.168.0.73:8080/nginx_status" Active connections: server accepts handled requests Reading: Writing: Waiting: [root@localhost conf]# curl -s "http://192.168.0.73:8080/nginx_status"…
.添加url监控脚本 [root@node1 usr]# vim /usr/local/zabbix_agents_3.2.0/scripts/web_site_code_status.sh #!/bin/bash UrlFile="/usr/local/zabbix_agents_3.2.0/scripts/WEB.txt" IFS=$'\n' web_site_discovery () { WEB_SITE=($(cat $UrlFile|grep -v "^#"…
cat  access.log |awk '{print $1,$9}'|grep '200'|sort | uniq -c|awk '{print $2" "$1}'…
ngx_string(ngx_http_error_494_page), /* 494, request header too large */    ngx_string(ngx_http_error_495_page), /* 495, https certificate error */    ngx_string(ngx_http_error_496_page), /* 496, https no certificate */    ngx_string(ngx_http_error_4…
最近了解下Nginx的Code状态码,在此简单总结下.一个http请求处理流程: 一个普通的http请求处理流程,如上图所示:A -> client端发起请求给nginxB -> nginx处理后,将请求转发到uwsgi,并等待结果C -> uwsgi处理完请求后,返回数据给nginxD -> nginx将处理结果返回给客户端每个阶段都会有一个预设的超时时间,由于网络.机器负载.代码异常等等各种原因,如果某个阶段没有在预期的时间内正常返回,就会导致这次请求异常,进而产生不同的状态码…
最近了解下Nginx的Code状态码,在此简单总结下. 先来再回顾一下一个http请求处理流程: 一个普通的http请求处理流程,如上图所示: A -> client端发起请求给nginx B -> nginx处理后,将请求转发到uwsgi,并等待结果 C -> uwsgi处理完请求后,返回数据给nginx D -> nginx将处理结果返回给客户端 每个阶段都会有一个预设的超时时间,由于网络.机器负载.代码异常等等各种原因,如果某个阶段没有在预期的时间内正常返回,就会导致这次请求…