mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Update plugins/mongodb/mongo_lag
fixed bug for python 2.6 and for replica sets with arbiters
This commit is contained in:
parent
bac376c23e
commit
ea5dde3fb4
@ -30,8 +30,9 @@ def _get_members():
|
||||
|
||||
members = {}
|
||||
for member in repl_status['members']:
|
||||
name = member['name'].split('.')[0]
|
||||
members[name] = {'state': member['state'], 'optimeDate': member['optimeDate']}
|
||||
if member['stateStr'] != 'ARBITER' :
|
||||
name = member['name'].split('.')[0]
|
||||
members[name] = {'state': member['state'], 'optimeDate': member['optimeDate']}
|
||||
return members
|
||||
|
||||
def run():
|
||||
@ -42,7 +43,7 @@ def run():
|
||||
|
||||
for member in members:
|
||||
lag = (primary_optime - members[member]['optimeDate']).seconds
|
||||
print "{}.value {}".format(member, lag)
|
||||
print "{0}.value {1}".format(member, lag)
|
||||
|
||||
def config():
|
||||
print """graph_title MongoDB replication lag
|
||||
|
Loading…
Reference in New Issue
Block a user