check_webservice_load.sh: support different timeouts for dchecking websites and PHP engine.
This commit is contained in:
parent
36a18cbf43
commit
e7b5812704
@ -176,6 +176,8 @@ detect_os
|
|||||||
# Some default values
|
# Some default values
|
||||||
#
|
#
|
||||||
DEFAULT_CONFLICTING_SCRIPTS="/root/bin/monitoring/check_local_webservice.sh"
|
DEFAULT_CONFLICTING_SCRIPTS="/root/bin/monitoring/check_local_webservice.sh"
|
||||||
|
DEFAULT_TIMEOUT_CHECK_WEBSITE=10
|
||||||
|
DEFAULT_TIMEOUT_CHECK_PHP=10
|
||||||
|
|
||||||
if [[ ! -f "$conf_file" ]]; then
|
if [[ ! -f "$conf_file" ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
@ -188,6 +190,9 @@ else
|
|||||||
source "$conf_file"
|
source "$conf_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ -n "$TIMEOUT_CHECK_WEBSITE" ]] || TIMEOUT_CHECK_WEBSITE="$DEFAULT_TIMEOUT_CHECK_WEBSITE"
|
||||||
|
[[ -n "$TIMEOUT_CHECK_PHP" ]] || TIMEOUT_CHECK_PHP="$DEFAULT_TIMEOUT_CHECK_PHP"
|
||||||
|
|
||||||
[[ -n "$CONFLICTING_SCRIPTS" ]] || CONFLICTING_SCRIPTS="$DEFAULT_CONFLICTING_SCRIPTS"
|
[[ -n "$CONFLICTING_SCRIPTS" ]] || CONFLICTING_SCRIPTS="$DEFAULT_CONFLICTING_SCRIPTS"
|
||||||
|
|
||||||
|
|
||||||
@ -2063,7 +2068,7 @@ if $check_apache ; then
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if ! $(curl -Is -m 10 http://$curl_check_host | head -n 1 | grep "200 OK" > /dev/null) ; then
|
if ! $(curl -Is -m $TIMEOUT_CHECK_WEBSITE http://$curl_check_host | head -n 1 | grep "200 OK" > /dev/null) ; then
|
||||||
echo -e "\nApache Webservice seems to be running, but is NOT responding! - Try to restart service.." >> $LOCK_DIR/extra_msg.txt
|
echo -e "\nApache Webservice seems to be running, but is NOT responding! - Try to restart service.." >> $LOCK_DIR/extra_msg.txt
|
||||||
echo -e "========================================================================================" >> $LOCK_DIR/extra_msg.txt
|
echo -e "========================================================================================" >> $LOCK_DIR/extra_msg.txt
|
||||||
|
|
||||||
@ -2108,7 +2113,7 @@ if $check_nginx ; then
|
|||||||
else
|
else
|
||||||
if ! $ommit_curl_check_nginx ; then
|
if ! $ommit_curl_check_nginx ; then
|
||||||
|
|
||||||
if ! $(curl -Is -m 10 http://$curl_check_host | head -n 1 | grep "200" > /dev/null) ; then
|
if ! $(curl -Is -m $TIMEOUT_CHECK_WEBSITE http://$curl_check_host | head -n 1 | grep "200" > /dev/null) ; then
|
||||||
|
|
||||||
# Same but via SSL
|
# Same but via SSL
|
||||||
#
|
#
|
||||||
@ -2172,11 +2177,11 @@ if $check_php_fpm ; then
|
|||||||
|
|
||||||
elif [[ -n ${php_fpm_ping_path[$_version]} ]] ; then
|
elif [[ -n ${php_fpm_ping_path[$_version]} ]] ; then
|
||||||
|
|
||||||
if ! $(curl -Is -m 10 http://${curl_check_host}/${php_fpm_ping_path[$_version]} | head -n 1 | grep "200" > /dev/null) ; then
|
if ! $(curl -Is -m $TIMEOUT_CHECK_PHP http://${curl_check_host}/${php_fpm_ping_path[$_version]} | head -n 1 | grep "200" > /dev/null) ; then
|
||||||
|
|
||||||
# Same via SSL
|
# Same via SSL
|
||||||
#
|
#
|
||||||
if ! $(curl --insecure -Is -m 10 https://${curl_check_host}/${php_fpm_ping_path[$_version]} | head -n 1 | grep "200" > /dev/null) ; then
|
if ! $(curl --insecure -Is -m $TIMEOUT_CHECK_PHP https://${curl_check_host}/${php_fpm_ping_path[$_version]} | head -n 1 | grep "200" > /dev/null) ; then
|
||||||
|
|
||||||
echo -e "\nPHP-FPM v$_version seems to be running, but is NOT responding! - Try to restart service.." >> $LOCK_DIR/extra_msg.txt
|
echo -e "\nPHP-FPM v$_version seems to be running, but is NOT responding! - Try to restart service.." >> $LOCK_DIR/extra_msg.txt
|
||||||
echo -e "====================================================================================" >> $LOCK_DIR/extra_msg.txt
|
echo -e "====================================================================================" >> $LOCK_DIR/extra_msg.txt
|
||||||
|
@ -58,6 +58,26 @@ check_php_fpm=true
|
|||||||
check_redis=false
|
check_redis=false
|
||||||
check_website=false
|
check_website=false
|
||||||
|
|
||||||
|
|
||||||
|
# TIMEOUT_CHECK_WEBSITE
|
||||||
|
#
|
||||||
|
# Maximum time in seconds that you allow for the response from the webserver.
|
||||||
|
#
|
||||||
|
# Defaults to:
|
||||||
|
# TIMEOUT_CHECK_WEBSITE=10
|
||||||
|
#
|
||||||
|
#TIMEOUT_CHECK_WEBSITE=10
|
||||||
|
|
||||||
|
# TIMEOUT_CHECK_PHP
|
||||||
|
#
|
||||||
|
# Maximum time in seconds that you allow for the response from the webserver.
|
||||||
|
#
|
||||||
|
# Defaults to:
|
||||||
|
# TIMEOUT_CHECK_PHP=10
|
||||||
|
#
|
||||||
|
#TIMEOUT_CHECK_PHP=10
|
||||||
|
|
||||||
|
|
||||||
# - If service is not listen on 127.0.0.1/loclhost, curl check must
|
# - If service is not listen on 127.0.0.1/loclhost, curl check must
|
||||||
# - be ommited
|
# - be ommited
|
||||||
# -
|
# -
|
||||||
|
Loading…
Reference in New Issue
Block a user