mirror of
https://github.com/shouptech/nagios-plugin-check-rabbitmq.git
synced 2026-02-03 14:49:41 +00:00
Added catch for urllib2.URLError (appears when connection is refused)
This commit is contained in:
parent
5e3db2f880
commit
a47d071925
1 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ except ImportError:
|
|||
# simplejson can be used with Python 2.4
|
||||
import simplejson as json
|
||||
|
||||
PLUGIN_VERSION = "0.1"
|
||||
PLUGIN_VERSION = "0.1.1"
|
||||
|
||||
class RabbitAPIChecker(object):
|
||||
"""Performs checks against the RabbitMQ API and returns the results"""
|
||||
|
|
@ -215,7 +215,7 @@ def main():
|
|||
except KeyError:
|
||||
print "UNKNOWN - %s is not a valid action" % args[0]
|
||||
return RabbitAPIChecker.STATE_UNKNOWN
|
||||
except urllib2.HTTPError, exception:
|
||||
except (urllib2.HTTPError, urllib2.URLError), exception:
|
||||
print "CRITICAL - %s" % exception
|
||||
return RabbitAPIChecker.STATE_CRITICAL
|
||||
except IndexError:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue