diff --git a/check_haproxy_health b/check_haproxy_health index 3b7640db1a45182b94bc44f6860721f35c09c2c4..50db6bb388afcda6d596cbed771c0166e2615b9d 100755 --- a/check_haproxy_health +++ b/check_haproxy_health @@ -21,7 +21,7 @@ export self_APPVERSION=1.6 . $(dirname $0)/inc_haproxy_cfg.sh -cfgfile=/etc/haproxy/haproxy.cfg + tmpfile=/tmp/check_haproxy_healthcheck_$$ # ---------------------------------------------------------------------- @@ -34,7 +34,15 @@ cat <<EOF $( ph.showImlHelpHeader ) Check HA Proxy health. -The plugin reads $cfgfile to detect required status url. +The plugin reads $HAPROXYcfgfile to detect required status url. +It requires wget to handle the http request. + +Non OK values occur: + UNKNOWN - if $HAPROXYcfgfile cannot be read + - haproxy is not in http mode + - the detected status url doesn't send a response + ERROR - the detected status url did not respond with Http status + code 200 SYNTAX: $_self [-h] @@ -65,12 +73,12 @@ esac ph.require wget -cat $cfgfile >/dev/null +cat $HAPROXYcfgfile >/dev/null if [ $? -ne 0 ]; then - ph.abort "UNKNOWN: unable to read ha proxy config $cfgfile ... $(ls -l $cfgfile)" + ph.abort "UNKNOWN: unable to read ha proxy config $HAPROXYcfgfile ... $(ls -l $HAPROXYcfgfile)" fi -cat $cfgfile | grep " mode .*http" >/dev/null +cat $HAPROXYcfgfile | grep " mode .*http" >/dev/null if [ $? -ne 0 ]; then ph.abort "UNKNOWN: haproxy is not in http mode" fi