Last active
April 26, 2017 16:22
-
-
Save ciavashkh/92e569002ff5979326f365e3365a4ef9 to your computer and use it in GitHub Desktop.
functions to check server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function c66_test_website { | |
curl -w " | |
time_namelookup: %{time_namelookup} | |
time_connect: %{time_connect} | |
time_appconnect: %{time_appconnect} | |
time_pretransfer: %{time_pretransfer} | |
time_redirect: %{time_redirect} | |
time_starttransfer: %{time_starttransfer} | |
------------------- | |
time_total: %{time_total} | |
" -o /dev/null -s $1 | |
} | |
function c66_test_nginx { | |
echo "number of nginx processes:" $(ps aux | grep [n]ginx | wc -l) | |
is_version_less_than_16=$(echo $(lsb_release --short --release)'<'16.04 | bc -l) | |
if [ $is_version_less_than_16 -eq 1 ] | |
then | |
echo "Nginx service status is:" | |
sudo service nginx status | |
else | |
echo "Nginx service status is:" | |
sudo service nginx status | grep Active | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment