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

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

Open
bert2002 opened this issue Jan 11, 2017 · 3 comments
Open

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

bert2002 opened this issue Jan 11, 2017 · 3 comments

Comments

@bert2002
Copy link

bert2002 commented Jan 11, 2017

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
Copy link
Author

Hi,

any thoughts on this?

Thanks

bert

@yuseferi
Copy link

yuseferi commented Oct 4, 2017

Have the same problem on update_once method

@sergeygolubev
Copy link

+1

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

3 participants