Skip to content

Commit

Permalink
new method to process /aliveness-test checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
alienth committed Apr 26, 2012
1 parent 5a42472 commit 5b3e52d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ZenPacks/community/RabbitMQ/parsers/RabbitMQAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def processResults(self, cmd, result):
# Route to the right parser based on the command.
if '/api/overview' in cmd.command:
self.processStatusResults(cmd, result)
elif '/api/aliveness-test' in cmd.command:
self.processAliveResults(cmd, result)
elif '/api/connections' in cmd.command:
self.processListConnectionsResults(cmd, result)
elif '/api/channels' in cmd.command:
Expand All @@ -80,6 +82,16 @@ def processStatusResults(self, cmd, result):
result.events.append(self.getEvent(
cmd, "node status is OK", clear=True))

def processAliveResults(self, cmd, result):

data = json.loads(result)
if data.['status'] == 'ok':
result.events.append(self.getEvent(
cmd, "alive check OK", clear=True))
else
result.events.append(self.getEvent(
cmd, "alive check failed"))

def processListConnectionsResults(self, cmd, result):
connections = {}

Expand Down

0 comments on commit 5b3e52d

Please sign in to comment.