Permalink
Browse files

Custom check in Consul.

  • Loading branch information...
darron committed Dec 26, 2014
1 parent 72cfb2e commit 73f5b175d0248402584cb0ec7384c50901940009
Showing with 10 additions and 1 deletion.
  1. +10 −1 bin/octo
View
@@ -373,9 +373,18 @@ case "$1" in
CONTAINER="$2"
PORT="$3"
TAGS=${4:-http}
+
+ CUSTOM_CHECK=$(/usr/bin/octo config:get $CONTAINER/CUSTOM_CHECK)
+ if [ -z "$CUSTOM_CHECK" ]
+ then
+ CHECK_COMMAND="curl -s http://$PRIVATE_IP:$PORT"
+ else
+ CHECK_COMMAND="$CUSTOM_CHECK"
+ fi
+
if echo $TAGS | grep -q 'http'
then
- CHECK=",\"check\": {\"script\": \"curl -s http://$PRIVATE_IP:$PORT\",\"interval\": \"60s\"}"
+ CHECK=",\"check\": {\"script\": \"$CHECK_COMMAND\",\"interval\": \"60s\"}"
else
CHECK=""
fi

0 comments on commit 73f5b17

Please sign in to comment.