Mongo 3.0.x Monitoring
Posted: Mon Dec 14, 2015 11:21 am
Hi,
We have Nagios 5.2.2 and are attempting to monitor our MongoDBs, running on 2 DB servers and 1 Arbiter. Mongo is running on 3.0.4. When attempting to connect to check any of the DB statistics, etc., we are receiving errors as follows:
(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mongodb.py", line 1372, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/nagios/libexec/check_mongodb.py", line 196, in main
err, con = mongo_connect(host, port, ssl, user, passwd, replicaset)
File "/usr/local/nagios/libexec/check_mongodb.py", line 294, in mongo_connect
return exit_with_general_critical(e), None
File "/usr/local/nagios/libexec/check_mongodb.py", line 310, in exit_with_general_critical
if e.strip() == "not master":
AttributeError: 'OperationFailure' object has no attribute 'strip'
The user account that I am account with is in the clusterAdmin Monogo role, so should have the rights to connect.
The same issues also arises when running from command line on the Nagios server. Using the same account that has been specified in the connection strings, I have been able to connect using Monog management tools (eg Mongo Chef).
Thanks,
Simon
We have Nagios 5.2.2 and are attempting to monitor our MongoDBs, running on 2 DB servers and 1 Arbiter. Mongo is running on 3.0.4. When attempting to connect to check any of the DB statistics, etc., we are receiving errors as follows:
(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_mongodb.py", line 1372, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/nagios/libexec/check_mongodb.py", line 196, in main
err, con = mongo_connect(host, port, ssl, user, passwd, replicaset)
File "/usr/local/nagios/libexec/check_mongodb.py", line 294, in mongo_connect
return exit_with_general_critical(e), None
File "/usr/local/nagios/libexec/check_mongodb.py", line 310, in exit_with_general_critical
if e.strip() == "not master":
AttributeError: 'OperationFailure' object has no attribute 'strip'
The user account that I am account with is in the clusterAdmin Monogo role, so should have the rights to connect.
The same issues also arises when running from command line on the Nagios server. Using the same account that has been specified in the connection strings, I have been able to connect using Monog management tools (eg Mongo Chef).
Thanks,
Simon