From 7353b56d6b628a0c1c3b2d5127c0edd6e348ff23 Mon Sep 17 00:00:00 2001 From: Jay SenSharma Date: Tue, 6 Mar 2018 10:26:11 +1100 Subject: [PATCH] Zookeeper service check fix.\n Command name is ZOOKEEPER_QUORUM_SERVICE_CHECK not ZOOKEEPER_SERVICE_CHECK --- ambari_trigger_service_checks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ambari_trigger_service_checks.py b/ambari_trigger_service_checks.py index 7e59b2277..7ec8e8ebd 100755 --- a/ambari_trigger_service_checks.py +++ b/ambari_trigger_service_checks.py @@ -356,6 +356,14 @@ def gen_payload(self, services=None): for index in range(service_count): service = services[index] index += 1 + + commandData = "" + if service.upper() == "ZOOKEEPER" : + # this if block is needed because the ZOOKEEPRR service check command name is "ZOOKEEPER_QUORUM_SERVICE_CHECK" and not "ZOOKEEPER_SERVICE_CHECK" + commandData = "{service}_QUORUM_SERVICE_CHECK".format(service=service.upper()) + else : + commandData = "{service}_SERVICE_CHECK".format(service=service.upper()) + payload[0]['RequestSchedule']['batch'][0]['requests'].append( { "order_id": index, @@ -363,7 +371,7 @@ def gen_payload(self, services=None): "uri": "/api/v1/clusters/{0}/requests".format(self.cluster), "RequestBodyInfo":{ "RequestInfo": { - "command": "{service}_SERVICE_CHECK".format(service=service.upper()), + "command": "{commandData}".format(commandData=commandData) , "context": "{service} Service Check (batch {index} of {total})". format(service=service, index=index, total=service_count) },