shell脚本每天自动统计网站访问日志并发送到钉钉
#!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin export PATH function notify(){ curl "https://oapi.dingtalk.com/robot/send?access_tok...
#!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin export PATH function notify(){ curl "https://oapi.dingtalk.com/robot/send?access_tok...
目前网上关于网站存活监控的脚本很多,本站也放过几个,今天给大家再来个ping+curl监控网站并发邮件报警的脚本,我觉得这个脚本的思路很不错,大家有兴趣的可以下来看看.
脚本内容:
cat /root/soft_shell/check-www.sh
#!/bin/bash #Created by haiyun #set -x while true do list=(blog.slogra.com slogra.com) mail=rocdk@163.com date=$(date -d "today" +"%Y-%m-%d-%H:%M:%S") i=0 id=${#list[*]} while [ $i -lt $id ]...
分析 特定url 哪些ip 访问次数分别是多少
cat /log/access.log | grep downfile | awk
‘{printf(”%s\n”,$1)}’ | sort | uniq -c | sort -n
分析apache日志得到蜘蛛ip的简单方法
cat
access_log | grep spider | awk -F ” ” ‘{print $1}’ | sort | uniq >
~/spider_ip.txt
1.查看apache进程:
ps aux | grep httpd | grep -v grep | wc
-l
2.查看80端口的tcp连接:
netstat -tan | grep "ESTABLISHED" | grep
":80" | wc -l