#!/bin/bash
#
#
D=`curl -k -o /dev/null -s -w "response_code: %{http_code}\n" https://platform.ringcentral.com/restapi/ | awk ' { print$2}'`
#echo $S
T=200
if [ $T = $D ] ; then
echo "Site is reachable"
else
echo "Site is down"
fi
You should beable to add to this and even set expect response time if your making functional changes based on extended times.
example we are looking for status code 200 and response time of 200ms or less could set the time
e.g
F=curl -k -o /dev/null -s -w "response_code: %{time_total}\n" https://platform.ringcentral.com/restapi/ | awk ' { print $2} ' | cut -d "."
And do a comparison against the variable to see if the value is less than 200ms
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
No comments:
Post a Comment