diff --git a/checks.d/mongo.py b/checks.d/mongo.py index 19b4e0ed77..ba6d450f16 100644 --- a/checks.d/mongo.py +++ b/checks.d/mongo.py @@ -11,6 +11,8 @@ # http://www.mongodb.org/display/DOCS/connections6 mongo_uri_re=re.compile(r'mongodb://(?P[^:@]+):(?P[^:@]+)@.*') +DEFAULT_TIMEOUT = 10 + class MongoDb(AgentCheck): GAUGES = [ @@ -130,7 +132,7 @@ def check(self, instance): self.log.debug("Mongo: cannot extract username and password from config %s" % instance['server']) do_auth = False - conn = Connection(instance['server']) + conn = Connection(instance['server'], network_timeout=DEFAULT_TIMEOUT) db = conn['admin'] if do_auth: if not db.authenticate(username, password):