Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clear how to implement script #29

Open
Genacvali opened this issue Sep 30, 2019 · 0 comments
Open

Not clear how to implement script #29

Genacvali opened this issue Sep 30, 2019 · 0 comments

Comments

@Genacvali
Copy link

Genacvali commented Sep 30, 2019

Hello

Could you please send the detailed instruction how to implement script to specific connection and if there multimple mongod services.
Shoul I create the config file for each service?
And how should i connect via ssl connections?

Here is configs:

class MongoDB(object):
"""main script class"""
# pylint: disable=too-many-instance-attributes
def init(self):
self.mongo_host = "10.9.69.35"
self.mongo_port = 11166
self.mongo_db = ["admin", ]
self.mongo_user = "zabbix_2"
self.mongo_password = "zabbix_2"
self.__conn = None
self.__dbnames = None
self.__metrics = []

And here is the erros

./zabbix-mongodb.py
Traceback (most recent call last):
File "./zabbix-mongodb.py", line 243, in
mongodb.get_db_names()
File "./zabbix-mongodb.py", line 73, in get_db_names
master = db_handler.command('isMaster')['ismaster']
File "/usr/lib64/python2.7/site-packages/pymongo/database.py", line 730, in command
read_preference, session) as (sock_info, slave_ok):
File "/usr/lib64/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 1299, in _socket_for_reads
server = self._select_server(read_preference, session)
File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 1254, in _select_server
server = topology.select_server(server_selector)
File "/usr/lib64/python2.7/site-packages/pymongo/topology.py", line 231, in select_server
address))
File "/usr/lib64/python2.7/site-packages/pymongo/topology.py", line 189, in select_servers
selector, server_timeout, address)
File "/usr/lib64/python2.7/site-packages/pymongo/topology.py", line 205, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: connection closed

Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant