1
0
Fork 0
mirror of https://github.com/shouptech/nagios-plugin-check-rabbitmq.git synced 2026-02-03 14:49:41 +00:00

Fix exit call on python 2.4.3

PEP 8 style fixes (pylint)
This commit is contained in:
Mike Shoup 2015-04-29 08:58:14 -06:00
parent f247cf0b05
commit 0ba59c23bb

View file

@ -6,6 +6,7 @@
the management API available."""
from optparse import OptionParser
import sys
import urllib2
import base64
import math
@ -102,6 +103,9 @@ class RabbitAPIChecker(object):
def check_nodes(self, args=None, critical=2, warning=1):
""" Checks if all nodes on the cluster are running"""
if args:
return ("UNKNOWN - Unexpected arguments found", self.STATE_UNKNOWN)
url = "http://%s:%s/api/nodes" % (self.hostname, self.port)
results = self.fetch_from_api(url)
@ -197,4 +201,4 @@ def main():
return state_code
if __name__ == "__main__":
exit(main())
sys.exit(main())