首页 / 操作系统 / Linux / 使用shell脚本分析网站日志统计PV、404、500等数据
下面的脚本能统计出网站的总访问量,以及404,500出现的次数。统计出来后,我们可以结合监控宝来进行记录,进而可以看出网站访问量是否异常,是否存在攻击,一目了然。还可以根据查看500出现的次数,进而判断网站程序是否出现异常。 复制代码 代码如下:#!/bin/bash #purpose:count nginx or apache or other webserver status code using jiankongbao #how to:run the script every 5 minutes with crontab