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

Add carryover of authentication to connect_primary check #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions check_mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def main(argv):
elif action == "chunks_balance":
chunks_balance(con, database, collection, warning, critical)
elif action == "connect_primary":
return check_connect_primary(con, warning, critical, perf_data)
return check_connect_primary(con, warning, critical, perf_data, user, passwd)
elif action == "collection_state":
return check_collection_state(con, database, collection)
elif action == "row_count":
Expand Down Expand Up @@ -1376,7 +1376,7 @@ def chunks_balance(con, database, collection, warning, critical):
sys.exit(0)


def check_connect_primary(con, warning, critical, perf_data):
def check_connect_primary(con, warning, critical, perf_data, user, passwd):
warning = warning or 3
critical = critical or 6

Expand All @@ -1395,7 +1395,7 @@ def check_connect_primary(con, warning, critical, perf_data):
pport = int(data['primary'].split(':')[1])
start = time.time()

err, con = mongo_connect(phost, pport)
err, con = mongo_connect(phost, pport, user=user, passwd=passwd)
if err != 0:
return err

Expand Down