Skip to content

Commit

Permalink
Fixed comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsjj committed Aug 20, 2011
1 parent 7b5d946 commit 40e971e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/chapter-10/api_queue_count_check.py
Expand Up @@ -56,13 +56,13 @@
print "UNKNOWN: Unexpected API error: %s" % response.read()
exit(EXIT_UNKNOWN)

#/(aqcc.7) RabbitMQ alive, return OK status
#/(aqcc.7) Extract message count levels from response
resp_payload = json.loads(response.read())
msg_cnt_unack = resp_payload["messages_unacknowledged"]
msg_cnt_ready = resp_payload["messages_ready"]
msg_cnt_total = resp_payload["messages"]

#/(aqcc.8) Consumed but unackowledged message count above limit
#/(aqcc.8) Consumed but unackowledged message count above thresholds
if msg_cnt_unack >= max_unack_critical:
print "CRITICAL: %s - %d unack'd messages." % (queue_name,
msg_cnt_unack)
Expand All @@ -72,7 +72,7 @@
msg_cnt_unack)
exit(EXIT_WARNING)

#/(aqcc.9) Ready to be consumed message count about limit
#/(aqcc.9) Ready to be consumed message count above thresholds
if msg_cnt_ready >= max_ready_critical:
print "CRITICAL: %s - %d unconsumed messages." % (queue_name,
msg_cnt_ready)
Expand All @@ -82,7 +82,7 @@
msg_cnt_ready)
exit(EXIT_WARNING)


# Message counts below thresholds, return OK status
print "OK: %s - %d in-flight messages. %dB used memory." % \
(queue_name, msg_cnt_total, resp_payload["memory"])
exit(EXIT_OK)

0 comments on commit 40e971e

Please sign in to comment.