mzupan / nagios-plugin-mongodb

A Nagios plugin to check the status of MongoDB
BSD 2-Clause "Simplified" License
346 stars 274 forks source link

TypeError: 'Collection' object is not callable. #211

Open bert2002 opened 7 years ago

bert2002 commented 7 years ago

Hi,

we are using the latest version of the plugin and replica_primary is not working anymore. We do this:

/usr/lib/nagios/plugins/check_mongodb.py -H $ADDRESS -A replica_primary -r shard01 Traceback (most recent call last): File "/usr/lib/nagios/plugins/check_mongodb.py", line 1587, in <module> sys.exit(main(sys.argv[1:])) File "/usr/lib/nagios/plugins/check_mongodb.py", line 258, in main return check_replica_primary(con, host, warning, critical, perf_data, replicaset, mongo_version) File "/usr/lib/nagios/plugins/check_mongodb.py", line 1359, in check_replica_primary db.last_primary_server.update_one({"_id": "last_primary"}, {"$set": last_primary_server_record}, upsert=True) File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 1489, in __call__ self.__name.split(".")[-1]) TypeError: 'Collection' object is not callable. If you meant to call the 'update_one' method on a 'Collection' object it is failing because no such method exists. Using python 2.7.6 on Ubuntu 14.04 and pymongo 2.6.3 against a mongodb master 3.2.4

Thanks

bert

bert2002 commented 7 years ago

Hi,

any thoughts on this?

Thanks

bert

yuseferi commented 7 years ago

Have the same problem on update_once method

sergeygolubev commented 6 years ago

+1