ZhuoRoger / mongomon

MongoDB performance monitor for open-falcon
48 stars 28 forks source link

'Database' object is not callable #4

Open zhangzice opened 7 years ago

zhangzice commented 7 years ago

请教下,正在测试falcon 对mongodb监控,刚刚部署好独立实例mongodb和 monitor,运行会报这个,请问下是什么问题?

[root@mongo_4 bin]# python mongodb_monitor.py Traceback (most recent call last): File "mongodb_monitor.py", line 91, in mongodb_dict = mongodb_monitor.get_mongo_monitor_data(conn) File "/data/mongomon/bin/mongodb_server.py", line 41, in get_mongo_monitor_data mongo_role = self.get_mongo_role(conn) File "/data/mongomon/bin/mongodb_server.py", line 33, in get_mongo_role elif ("chunks" in conn.get_database("config").collection_names()): # Role is a config servers? not mongos and has config.chunks collections. it's a config server. File "/usr/lib64/python2.6/site-packages/pymongo/database.py", line 797, in call self.name, self.connection.class.name)) TypeError: 'Database' object is not callable. If you meant to call the 'get_database' method on a 'MongoClient' object it is failing because no such method exists.

zhangzice commented 7 years ago

解决了,对Pymongo版本也需要有依赖 目前安装的3.3.0 解决