From 051eae827f01f32715a5bd5129093df54192cc93 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 13 Jan 2014 17:52:59 +0000 Subject: [PATCH] nagios test if the the service proxy is up and running, MKWS-81 --- tools/bin/nagios-service-proxy.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/bin/nagios-service-proxy.sh diff --git a/tools/bin/nagios-service-proxy.sh b/tools/bin/nagios-service-proxy.sh new file mode 100755 index 0000000..9d58a31 --- /dev/null +++ b/tools/bin/nagios-service-proxy.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (c) 2014 Index Data ApS, http://indexdata.com +# +# nagios test if the the service proxy is up and running + +set -e +: ${mkws_host="http://mkws.indexdata.com/service-proxy/"} +: ${mkws_username="mkws"} +: ${mkws_password="mkws"} + +tempfile=$(mktemp) +exit=0 + +url="$mkws_host?command=auth&action=login&username=$mkws_username&password=$mkws_password" +if curl -sSf "$url" > $tempfile; then + if ! egrep -q 'OK' $tempfile; then + echo "status not OK" + exit=1 + fi + if ! egrep -q '