Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zookeeper service check fix.\n Command name is ZOOKEEPER_QUORUM_SERVI… #5

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion ambari_trigger_service_checks.py
Expand Up @@ -356,14 +356,22 @@ 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,
"type": "POST",
"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)
},
Expand Down