From d828c825c58f2da4b4edd6548c5fd254842a0add Mon Sep 17 00:00:00 2001 From: David Vossel Date: Wed, 29 Apr 2015 11:15:18 -0500 Subject: [PATCH 4/6] nginx agent support --- heartbeat/nginx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/heartbeat/nginx b/heartbeat/nginx index 65fd8f2..fadc545 100755 --- a/heartbeat/nginx +++ b/heartbeat/nginx @@ -31,7 +31,7 @@ # OCF_RESKEY_status10regex # OCF_RESKEY_status10url # OCF_RESKEY_client -# OCF_RESKEY_testurl +# OCF_RESKEY_test20url # OCF_RESKEY_test20regex # OCF_RESKEY_test20conffile # OCF_RESKEY_test20name @@ -416,7 +416,7 @@ start_nginx() { return $OCF_SUCCESS fi if - ocf_run $NGINXD -t -c $CONFIGFILE + ocf_run $NGINXD $OPTIONS -t -c $CONFIGFILE then : Configuration file $CONFIGFILE looks OK else @@ -442,7 +442,7 @@ start_nginx() { [ $ec -eq $OCF_NOT_RUNNING ] then tries=`expr $tries + 1` - ocf_log info "Waiting for $NGINXD -c $CONFIGFILE to come up (try $tries)" + ocf_log info "Waiting for $NGINXD $OPTIONS -c $CONFIGFILE to come up (try $tries)" true else false @@ -727,25 +727,25 @@ For example, you can set this paramter to "wget" if you prefer that to curl. - + URL to test. If it does not start with "http", then it's considered to be relative to the document root address. -Level 10 monitor url +Level 20 monitor url -Regular expression to match in the output of testurl. +Regular expression to match in the output of test20url. Case insensitive. Level 20 monitor regular expression - + A file which contains a more complex test configuration. Could be useful if you have to check more than one web application or in case sensitive @@ -785,14 +785,11 @@ Extra options to apply when starting nginx. - + - - - - + @@ -838,11 +835,11 @@ validate_all_nginx() { exit $OCF_ERR_CONFIGURED fi if - ocf_run $NGINXD -t -c $CONFIGFILE + ocf_run $NGINXD $OPTIONS -t -c $CONFIGFILE then : Cool $NGINXD likes $CONFIGFILE else - ocf_log err "$NGINXD -t -c $CONFIGFILE reported a configuration error." + ocf_log err "$NGINXD $OPTIONS -t -c $CONFIGFILE reported a configuration error." return $OCF_ERR_CONFIGURED fi return $OCF_SUCCESS @@ -859,7 +856,7 @@ then OPTIONS="$OCF_RESKEY_options" CLIENT=${OCF_RESKEY_client} TESTREGEX=${OCF_RESKEY_status10regex:-'Reading: [0-9]+ Writing: [0-9]+ Waiting: [0-9]+'} - TESTURL="$OCF_RESKEY_status10url" + TESTURL="$OCF_RESKEY_test20url" TESTREGEX20=${OCF_RESKEY_test20regex} TESTCONFFILE="$OCF_RESKEY_test20conffile" TESTNAME="$OCF_RESKEY_test20name" -- 1.8.4.2