[[email protected] ftpsite]$ cat check_80.sh
#!/bin/bash
function check_url() {
D=$(date +%H%M%S)
curl --connect-timeout 10 -m 20 "127.0.0.1:80" > /dev/null
r_curl=$(echo $?)
}
check_url
if [ $r_curl == 0 ];then
echo "$D nginx Normal"
else
echo "$D nginx fail"
fi
exit 0
时间: 2024-10-13 17:35:12