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

Mongo v3.4 , maybe some api has changed , #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
18 changes: 10 additions & 8 deletions collectors/0/mongo3.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,20 @@ def runDbStats(c):
continue
print 'mongo.db.%s %d %s db=%s' % (metric, ts, cur, db_name)

raw_metrics = res['raw']
for key, value in raw_metrics.items():

# raw_metrics = res['raw']
# for key, value in raw_metrics.items():
for key, value in res.items():
replica_name = key.split('/', 1)[0]
replica_desc = key.split('/', 1)[1]
# replica_desc = key.split('/', 1)[1]

for metric in MONGOS_RAW_METRICS:
cur = value
try:
for m in metric.split('.'):
cur = cur[m]
except KeyError:
continue
# try:
# for m in metric.split('.'):
# cur = cur[m]
# except KeyError:
# continue
print 'mongo.rs.%s %d %s replica=%s db=%s' % (metric, ts, cur, replica_name, db_name)

def runReplSetGetStatus(c):
Expand Down
2 changes: 1 addition & 1 deletion collectors/etc/mongodb3_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def get_settings():
return {
"db": "db1,db2",
"db": "argus-alert,argus-statistics,argus-users,argus-web",
"config": "192.168.0.10:27017,192.168.0.11:27017",
"mongos": "192.168.0.13:27017",
"replica": "192.168.0.14:27017",
Expand Down