2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

added mongodb URI for configuration

defining settings_mongodb_uri will override settings_host and settings_port
This commit is contained in:
Nico Casar Gonzalez 2016-08-18 19:27:04 -03:00 committed by GitHub
parent 887063d53c
commit 9121b90ee0

View File

@ -38,6 +38,8 @@ from operator import itemgetter
settings_host = '127.0.0.1'
settings_port = 27017
# mongodb_uri will override host and port
settings_mongodb_uri = ''
settings_db = 'mydb'
settings_user = ''
settings_password = ''
@ -86,7 +88,10 @@ typeIndex['indexsize']['category'] = 'MongoDB'
def getCollstats(graphtype):
con = pymongo.MongoClient(settings_host, int(settings_port))
if settings_mongodb_uri:
con = pymongo.MongoClient(settings_mongodb_uri)
else:
con = pymongo.MongoClient(settings_host, int(settings_port))
if settings_user:
db = con['admin']