janneyabc 发表于 2018-11-21 06:19:24

截取web页面访问时间(Apache)

#!/bin/bash
lsof -i :80&> /dev/null
LS=`echo $?`
elinkshttp://192.168.5.14 -dump &> /dev/null
CA=`echo $?`
T=`curl -s -o/dev/null -w %{time_total}"\n" "http://192.168.5.14" | cut-d "." -f1`
if [ $LS -ne 0];then
      echo "unknow apache";exit 3
elif [ $CA -ne 0];then
      echo "warning:there is somethingwrong with apache";exit 2
elif [ $T -ge 5];then
      echo "warning:Response time is $Ts";exit 2
else
      echo "Response time isok";exit 0
fi
  




页: [1]
查看完整版本: 截取web页面访问时间(Apache)