Hello All,
I'm attempting to use check_mongodb.py script and its failing on initial connection test. Destination server is up and port is accessible via netcat. The error is below:
./check_mongodb.py -H X.X.X.X -P 27017
CRITICAL - Connection to Mongo server on X.X.X.X:27017 has failed
Error is not very informative. Any ideas on what I may be missing?
Thanks
check_mongodb.py connection failure
- jmichaelson
- Posts: 375
- Joined: Wed Aug 23, 2023 1:02 pm
Re: check_mongodb.py connection failure
Hi @ksafa,
Can you go to a shell prompt and execute the following:
And post the output here?
Can you go to a shell prompt and execute the following:
Code: Select all
pip show pymongoPlease let us know if you have any other questions or concerns.
-Jason
-Jason
Re: check_mongodb.py connection failure
Hi @ksafa,
Are you providing username and password? Something like this...
Are you providing username and password? Something like this...
Code: Select all
./check_mongodb.py -H x.x.x.x -P port -u USER -p PASSWD
Please let us know if you have any other questions or concerns.
-Laura
-Laura
Re: check_mongodb.py connection failure
Made some more progress. It seems the error in the Mongo logs is "SSLHandshakeFailed" "The server is configured to only allow SSL connections". When I attempted to add ssl parameters to command i received following error (also not sure if my syntax is off):
./check_mongodb.py -H X.X.X.X -P 27017 -u USER -p PASSWD --ssl --ssl-ca-cert-file=/path/to/cert.pem
CRITICAL - General MongoDB Error: Unknown option ssl_cert_reqs
I was reading somewhere about ssl_cert_reqs being deprecated in pymongo 3.9. I'm currently running 4.3.3. Is there an updated check_mongodb.py that uses tls instead of ssl ?
#pip3.9 show pymongo
Name: pymongo
Version: 4.3.3
Summary: Python driver for MongoDB <http://www.mongodb.org>
Home-page: http://github.com/mongodb/mongo-python-driver
Author: The MongoDB Python Team
Author-email:
License: Apache License, Version 2.0
Location: /usr/lib64/python3.9/site-packages/pymongo-4.3.3-py3.9-linux-x86_64.egg
Requires: dnspython
Required-by:
./check_mongodb.py -H X.X.X.X -P 27017 -u USER -p PASSWD --ssl --ssl-ca-cert-file=/path/to/cert.pem
CRITICAL - General MongoDB Error: Unknown option ssl_cert_reqs
I was reading somewhere about ssl_cert_reqs being deprecated in pymongo 3.9. I'm currently running 4.3.3. Is there an updated check_mongodb.py that uses tls instead of ssl ?
#pip3.9 show pymongo
Name: pymongo
Version: 4.3.3
Summary: Python driver for MongoDB <http://www.mongodb.org>
Home-page: http://github.com/mongodb/mongo-python-driver
Author: The MongoDB Python Team
Author-email:
License: Apache License, Version 2.0
Location: /usr/lib64/python3.9/site-packages/pymongo-4.3.3-py3.9-linux-x86_64.egg
Requires: dnspython
Required-by:
Re: check_mongodb.py connection failure
Hey @ksafaksafa wrote: ↑Tue Jan 14, 2025 4:24 pm Made some more progress. It seems the error in the Mongo logs is "SSLHandshakeFailed" "The server is configured to only allow SSL connections". When I attempted to add ssl parameters to command i received following error (also not sure if my syntax is off):
./check_mongodb.py -H X.X.X.X -P 27017 -u USER -p PASSWD --ssl --ssl-ca-cert-file=/path/to/cert.pem
CRITICAL - General MongoDB Error: Unknown option ssl_cert_reqs
I was reading somewhere about ssl_cert_reqs being deprecated in pymongo 3.9. I'm currently running 4.3.3. Is there an updated check_mongodb.py that uses tls instead of ssl ?
#pip3.9 show pymongo
Name: pymongo
Version: 4.3.3
Summary: Python driver for MongoDB <http://www.mongodb.org>
Home-page: http://github.com/mongodb/mongo-python-driver
Author: The MongoDB Python Team
Author-email:
License: Apache License, Version 2.0
Location: /usr/lib64/python3.9/site-packages/pymongo-4.3.3-py3.9-linux-x86_64.egg
Requires: dnspython
Required-by:
Unfortunately it looks like we don't have an updated version currently that uses tls instead of ssl. I will open up a ticket for a feature request to add this.
Re: check_mongodb.py connection failure
Do you know what the turn around time will be on such a request?
Thank you
Thank you
Re: check_mongodb.py connection failure
Hi @ksafa,
We do not have access to when issues are scheduled for development. You can keep an eye out in the CHANGELOG for the tag [GL:XI#1438].
We do not have access to when issues are scheduled for development. You can keep an eye out in the CHANGELOG for the tag [GL:XI#1438].
Please let us know if you have any other questions or concerns.
-Laura
-Laura