多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
root@lingdang-21:/etc/zabbix/zabbix_agentd.conf.d# cat nginx_time.sh ``` #!/bin/bash check_time=$(/bin/date -d "-10 min" +%d/%b/%Y:%H:%M) time1=$(/bin/date -d "-10 min" +%d/%b/%Y:%H:%M) time2=$(/bin/date +%d/%b/%Y:%H:%M) bbs_request(){ > /tmp/bbs_time.log line1=$(egrep -n "${time1}" /usr/local/nginx/logs/bbs.goumin.com_access.log|head -1|awk -F":" '{print $1}') line2=$(cat /usr/local/nginx/logs/bbs.goumin.com_access.log|wc -l) sed -n "${line1},${line2}p" /usr/local/nginx/logs/bbs.goumin.com_access.log|grep "GET /thread-" >> /tmp/bbs_time.log awk '{sum+=$NF} END {print sum/NR}' /tmp/bbs_time.log } m_goumin_request(){ > /tmp/m_time.log line1=$(egrep -n "${time1}" /usr/local/nginx/logs/m.goumin.com_access.log|head -1|awk -F":" '{print $1}') line2=$(cat /usr/local/nginx/logs/m.goumin.com_access.log|wc -l) sed -n "${line1},${line2}p" /usr/local/nginx/logs/m.goumin.com_access.log|grep "GET /bbs/thread-" >> /tmp/m_time.log awk '{sum+=$NF} END {print sum/NR}' /tmp/m_time.log } case $1 in bbs) bbs_request; ;; m_goumin) m_goumin_request; ;; *) echo "$0 {bbs|m_goumin}" esac ```