From 203f12d1b43bd55ce7e45e864ccb1a839ee5d9af Mon Sep 17 00:00:00 2001 From: WBTMagnum Date: Mon, 28 Nov 2016 22:37:14 +0100 Subject: [PATCH] fixed default prefix handling for ES 5.x compatibility (fixes #43) --- check_elasticsearch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_elasticsearch b/check_elasticsearch index a1d39a2..63da129 100755 --- a/check_elasticsearch +++ b/check_elasticsearch @@ -96,7 +96,7 @@ class ElasticSearchCheck(NagiosCheck): host = opts.host or "localhost" port = int(opts.port or '9200') prefix = opts.prefix or "" - if not prefix.endswith('/'): + if len(prefix) > 0 and not prefix.endswith('/'): prefix += '/' failure_domain = []