check_webservice_load.sh: if connection failed try also SSL befor alert an error.

This commit is contained in:
Christoph 2020-05-30 03:29:17 +02:00
parent 875465aab7
commit c0c0b2487c

View File

@ -2009,13 +2009,22 @@ if $check_nginx ; then
else
if ! $ommit_curl_check_nginx ; then
if ! $(curl -Is -m 10 http://$curl_check_host | head -n 1 | grep "200 OK" > /dev/null) ; then
echo -e "\nNginx 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
if ! $(curl -Is -m 10 http://$curl_check_host | head -n 1 | grep "200" > /dev/null) ; then
# Same but via SSL
#
if ! $(curl --insecure -Is -m 10 https://$curl_check_host | head -n 1 | grep "200" > /dev/null) ; then
echo -e "\nNginx 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
error "Nginx Webservice seems to be running, but is NOT responding! - Try to restart service.."
error "Nginx Webservice seems to be running, but is NOT responding! - Try to restart service.."
restart_nginx
restart_nginx
else
if $LOGGING ; then
ok "Nginx Webserver on \"`hostname -f`\" seems to be running.."
fi
fi
else
@ -2063,16 +2072,24 @@ if $check_php_fpm ; then
restart_php_fpm $_version
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 OK" > /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 "====================================================================================" >> $LOCK_DIR/extra_msg.txt
if ! $(curl -Is -m 10 http://${curl_check_host}/${php_fpm_ping_path[$_version]} | head -n 1 | grep "200" > /dev/null) ; then
error "PHP-FPM v$_version seems to be running, but is NOT responding! - Try to restart service.."
# 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
restart_php_fpm $_version
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
error "PHP-FPM v$_version seems to be running, but is NOT responding! - Try to restart service.."
restart_php_fpm $_version
else
if $LOGGING ; then
ok "PHP-FPM v$_version engine on \"`hostname -f`\" seems to be running.."
fi
fi
else
if $LOGGING ; then
ok "PHP-FPM v$_version engine on \"`hostname -f`\" seems to be running.."