页首自改代码

Hey, Nice to meet You.  why ?

☆☆☆所谓豪杰之士,必有过人之节.人情有所不能忍者,匹夫见辱,拔剑而起,挺身而斗,此不足为勇也,天下有大勇者,猝然临之而不惊,无故加之而不怒.此其所挟持者甚大,而其志甚远也.          
返回顶部

Zabbix监控PV和UV

 

Zabbix-server:172.21.97.153

Zabbix-agent(Nginx):172.17.27.61

# Nginx日志如下:

# head -3 Syz.access.log

www.qcxin.com 39.67.200.12 [17/Aug/2018:01:20:55 +0800] "GET /pci-doctor/api/verification_code/register?mobile=17686984883 HTTP/1.1" 404 162 "-" "Dalvik/2.1.0 (Linux; U; Android 5.1.1; vivo Xplay5A Build/LMY47V)" 0.000 - 172.17.27.60

www.qcxin.com 58.214.14.250 [17/Aug/2018:01:22:17 +0800] "GET /pci-doctor/api/verification_code/register?mobile=13717177753 HTTP/1.1" 404 162 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; M5 Build/MRA58K)" 0.000 - 172.17.27.60

www.qcxin.com 120.229.234.239 [17/Aug/2018:01:24:22 +0800] "GET /pci-doctor/api/verification_code/register?mobile=18306648785 HTTP/1.1" 404 162 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; MI 4LTE MIUI/8.2.1)" 0.000 - 172.17.27.60

# 通过日志提取访问信息,脚本如下:

[root@sicknginx1 ~]# cat /kzh/scripts/traffic_statistics_all.sh

#!/bin/bash
#====================================================
# Author: kazihuo
# Create Date: 2018-08-17
# Description: Traffic statistics with UV and PV.
#====================================================

#UV
uv(){
    cat /logs/www.Syz.com/Syz.access.log |awk '{print $2}'|sort|uniq -c|wc -l
}

#PV
pv(){
    cat /logs/www.Syz.com/Syz.access.log |awk '{print $6}'|wc -l    
}

$1
View Code

# 添加item;

# 创建Granphs;

# 创建完后在MonitoringàScreensàCreate screen;将创建的Granphs链接进来即可;效果如下:

 

 

posted on 2018-08-17 16:25  罗穆瑞  阅读(1252)  评论(0编辑  收藏  举报

导航