Mongo DB monitoring Error
Posted: Wed Feb 27, 2019 4:09 am
Hi Team,
We are trying to monitor our Mongo DB servers which are in cluster.
Nagios XI = 5.5.7
Python version on Nagios Xi server = 2.6.6
Mongo DB server Version = v3.6.5
Tested connectivity from Nagios Xi server to Mongo DB server using telnet & its working.
We created user with "clusterAdmin" role. tested login from Nagios XI server using mongo shell & able to successfully login on mongo DB server.
However when we trying to monitor mongo DB server using below command we are getting below error.
================
/usr/local/nagios/libexec/check_mongodb.py -H xxx.xxx.xxx.xxx -A connect -P xxxxx -W 2 -C 4 -u xxxxxxxx -p xxxxxxxx -D --all-databases
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'
================
Note = we are using backdated version of "check_mongodb.py" as we are not planning to upgrade python version & upgraded "check_mongodb.py" i guess required python 2.7.x. so we using backdated version of "check_mongodb.py" from which we are able to successfully monitor other mongo servers which are not in cluster.
when we tried with upgraded "check_mongodb.py" we got below error.
=============
/usr/local/nagios/libexec/check_mongodb_upgrade.py -H xxx.xxx.xxx.xxx -A connect -P xxxxx -W 2 -C 4 -u xxxxxxxx -p xxxxxxxx -D --all-databases
Username/Password incorrect
=============
Attached () for the error we are getting on XI.
Please suggest the fix for the same.
We are trying to monitor our Mongo DB servers which are in cluster.
Nagios XI = 5.5.7
Python version on Nagios Xi server = 2.6.6
Mongo DB server Version = v3.6.5
Tested connectivity from Nagios Xi server to Mongo DB server using telnet & its working.
We created user with "clusterAdmin" role. tested login from Nagios XI server using mongo shell & able to successfully login on mongo DB server.
However when we trying to monitor mongo DB server using below command we are getting below error.
================
/usr/local/nagios/libexec/check_mongodb.py -H xxx.xxx.xxx.xxx -A connect -P xxxxx -W 2 -C 4 -u xxxxxxxx -p xxxxxxxx -D --all-databases
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'
================
Note = we are using backdated version of "check_mongodb.py" as we are not planning to upgrade python version & upgraded "check_mongodb.py" i guess required python 2.7.x. so we using backdated version of "check_mongodb.py" from which we are able to successfully monitor other mongo servers which are not in cluster.
when we tried with upgraded "check_mongodb.py" we got below error.
=============
/usr/local/nagios/libexec/check_mongodb_upgrade.py -H xxx.xxx.xxx.xxx -A connect -P xxxxx -W 2 -C 4 -u xxxxxxxx -p xxxxxxxx -D --all-databases
Username/Password incorrect
=============
Attached () for the error we are getting on XI.
Please suggest the fix for the same.