diff --git a/check_webservice_load.sh b/check_webservice_load.sh index 23b7590..49f7744 100755 --- a/check_webservice_load.sh +++ b/check_webservice_load.sh @@ -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.."