sensu-plugins-mongodb 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/bin/check-mongodb.py +10 -4
- data/lib/sensu-plugins-mongodb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adbff6eb2e9cf5561f9934b9d1adb3113271c7fe
|
4
|
+
data.tar.gz: 9a5736e402cfb088cb0b07bb03a72d810c3d0bac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f57055be8c51424806f80ba63bc784f0d2d5865cc182e22c8ab64767842cd59793cf798f2a53c80e715469b7e96e1330460eed2897619560287483e1f9058977
|
7
|
+
data.tar.gz: 3cf34b90f91e2996c35bc975d2c3767c51c777da775896e168ffa72c9a8ff21ae4f5ad71dba7248d144e0be82d1326bb638dd700b1d3d6dafc8cec1e2ccfc1d9
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
## [1.2.2]
|
8
|
+
### Fixed
|
9
|
+
- `check-mongodb.py`: will now correctly crit on connection issues (@majormoses)
|
7
10
|
## [1.2.1] - 2017-05-07
|
8
11
|
### Fixed
|
9
12
|
- `check-mongodb.py`: fixed issue of param building with not/using ssl connections (@s-schweer)
|
data/bin/check-mongodb.py
CHANGED
@@ -278,15 +278,21 @@ def mongo_connect(host=None, port=None, ssl_enabled=False, ssl_certfile=None, ss
|
|
278
278
|
# ssl connection for pymongo > 2.3
|
279
279
|
if pymongo.version >= "2.3":
|
280
280
|
if replica is None:
|
281
|
-
if ssl_enabled:
|
281
|
+
if ssl_enabled:
|
282
282
|
con = pymongo.MongoClient(host, port, ssl=ssl_enabled, ssl_certfile=ssl_certfile, ssl_keyfile=ssl_keyfile, ssl_ca_certs=ssl_ca_certs)
|
283
|
-
else:
|
283
|
+
else:
|
284
284
|
con = pymongo.MongoClient(host, port)
|
285
285
|
else:
|
286
|
-
if ssl_enabled:
|
286
|
+
if ssl_enabled:
|
287
287
|
con = pymongo.Connection(host, port, read_preference=pymongo.ReadPreference.SECONDARY, ssl=ssl_enabled, ssl_certfile=ssl_certfile, ssl_keyfile=ssl_keyfile, ssl_ca_certs=ssl_ca_certs, replicaSet=replica, network_timeout=10)
|
288
|
-
else:
|
288
|
+
else:
|
289
289
|
con = pymongo.Connection(host, port, read_preference=pymongo.ReadPreference.SECONDARY, replicaSet=replica, network_timeout=10)
|
290
|
+
try:
|
291
|
+
# https://api.mongodb.com/python/current/api/pymongo/mongo_client.html
|
292
|
+
# The ismaster command is cheap and does not require auth.
|
293
|
+
con.admin.command('ismaster', connectTimeoutMS=10000)
|
294
|
+
except Exception, e:
|
295
|
+
return exit_with_general_critical(e), None
|
290
296
|
else:
|
291
297
|
if replica is None:
|
292
298
|
con = pymongo.Connection(host, port, slave_okay=True, network_timeout=10)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-mongodb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson
|