Commit 63e46ad7 by zhangwei

add company

parent 3dd10ebd
......@@ -39,6 +39,11 @@
"project_name": "les",
"log_file": "/data/logs/les/app.log",
"check_string": "'error'"
},
{
"project_name": "skapp",
"log_file": "/data/logs/skapp/app/app.log",
"check_string": "'error'"
}
]
}
......@@ -9,7 +9,7 @@ eventtime=$(date +"%Y-%m-%d %H:%M:%S")
touser=$useropenid
first="$subject"
keyword1="severity"
keyword1="$severity"
keyword2=$content
keyword3=$eventtime
remark=""
......
#!/bin/bash
cd /data/neoteched/ops/company/
function alert() {
content=$1
severity=$2
./AlertWeixin.sh oLvc1wW388DWx1eW1ovLh1yuvfaQ "$content" "$severity"
sleep 1
./AlertWeixin.sh oLvc1wXw2rvqtH-dg-r-zIupr3To "$content" "$severity"
sleep 1
./AlertWeixin.sh oLvc1wVZKLo3j7owTeRHUbPU8uuU "$content" "$severity"
}
ip=210.12.30.146
stime=$(date +"%H")
stime=$(date +"%H%M")
#ip=210.12.30.31
rs=$(ping -c 2 $ip |awk 'NR==6 {print $4}')
if [ "$rs" != "2" ];then
content="ping down"
severity="Worning"
severity="Warning"
alert "$content" "$severity"
exit 0
fi
if [ "$stime" == "23" ];then
content="ping up"
if [ "$stime" == "1000" ];then
content="ping check every day"
severity="OK"
alert "$content" "$severity"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment