From: Wolfram Schneider Date: Tue, 14 Jan 2014 10:31:14 +0000 (+0000) Subject: use a special UserAgent for curl requests: X-Git-Tag: 1.0.0~1694 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=2d1143b3262a732653a567b73cf8fb1251454c9a use a special UserAgent for curl requests: nagios service-proxy v0.9 --- diff --git a/tools/bin/nagios-service-proxy.sh b/tools/bin/nagios-service-proxy.sh index 9d58a31..2904e85 100755 --- a/tools/bin/nagios-service-proxy.sh +++ b/tools/bin/nagios-service-proxy.sh @@ -7,12 +7,13 @@ set -e : ${mkws_host="http://mkws.indexdata.com/service-proxy/"} : ${mkws_username="mkws"} : ${mkws_password="mkws"} +: ${user_agent="nagios service-proxy v0.9"} tempfile=$(mktemp) exit=0 url="$mkws_host?command=auth&action=login&username=$mkws_username&password=$mkws_password" -if curl -sSf "$url" > $tempfile; then +if curl -sSf -A "$user_agent" "$url" > $tempfile; then if ! egrep -q 'OK' $tempfile; then echo "status not OK" exit=1