-
Notifications
You must be signed in to change notification settings - Fork 273
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
Can't get DB/collection/index stats in a replica set. #206
Comments
Same problem here and only for for the replication_lag check. Any solution? |
Any thoughts or ideas? |
Yep, it will be the read preference that it is trying to set. Either your pymongo driver or mongodb instance is low rev and has a problem setting read preference to secondary. Initially try commenting out the line "set_read_preference(con.admin)" on line 961 of the check mongodb script to see if it runs ok, then let us know version of pymongo driver and mongodb |
...also is this a standalone db or a replica set, and if it IS an RS, how many nodes? |
Hi, /usr/lib/nagios/plugins/check_mongodb.py -H $ADDRESS -A replication_lag |
Argh. Just used the latest version of the plugin and it seems to work: python check_mongodb.py -H $ADDRESS -A replication_lag |
Be aware that you cannot do stat quries on Arbiters. This code in the mongo_connect function just returns that message:
So to get a valid result for the repl lag, you will need to query a secondary or primary, not an arbiter |
Ohhh thats a good point. When I query a primary I get this: /usr/lib/nagios/plugins/check_mongodb.py -H $ADDRESS -A replication_lag Looks much better now :) Thx for pointing this out. |
Trying to run check_mongodb.py against a replica set with this -
check_mongodb.py -H mongohostX -A database_indexes -P 27017 -d database -u mongouser -p secret
it returns -
CRITICAL - General MongoDB Error: 'module' object has no attribute 'Secondary'
I have tried connecting to both my primary and secondary servers in a replica set and get the same failure.
The text was updated successfully, but these errors were encountered: