标签:log $? 报警 sort kpi echo wget connect 状态码
加检测:
1.ip
ping
curl
wget
检测 192.168.11.1444
ping -c 1 -w 1 192.168.11.21444
2.ip 加 端口
telnet
echo -e "\n" | telnet 192.168.11.2144 13000 | grep Connected
3.进程
ps aux|grep -v grep|grep nginx
echo $?
4.log
基于状态码的检测:
tail -n100 /home/iqiyi4logs/iq444iyi444.log|awk -F", ‘{ print $8}‘|sort -nr|uniq -c 一共有什么状态 有几个
tail -n100 /home/iqiyi4logs/iq4iy44i.log|awk -F", ‘{ print $8}‘|grep "200"|wc -l 200的状态有几个
基于单位时间段内请求的访问 如果次数未达kpi异常 报警
tail -n1000 /home/iqiyilogs/iqiyi.log|grep "14/Jan/2020:16:54"|wc -l
标签:log $? 报警 sort kpi echo wget connect 状态码
原文地址:https://www.cnblogs.com/djwhome/p/12198242.html