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
1 changed files with 4 additions and 3 deletions
|
@ -30,6 +30,7 @@ def _get_members():
|
||||||
|
|
||||||
members = {}
|
members = {}
|
||||||
for member in repl_status['members']:
|
for member in repl_status['members']:
|
||||||
|
if member['stateStr'] != 'ARBITER' :
|
||||||
name = member['name'].split('.')[0]
|
name = member['name'].split('.')[0]
|
||||||
members[name] = {'state': member['state'], 'optimeDate': member['optimeDate']}
|
members[name] = {'state': member['state'], 'optimeDate': member['optimeDate']}
|
||||||
return members
|
return members
|
||||||
|
@ -42,7 +43,7 @@ def run():
|
||||||
|
|
||||||
for member in members:
|
for member in members:
|
||||||
lag = (primary_optime - members[member]['optimeDate']).seconds
|
lag = (primary_optime - members[member]['optimeDate']).seconds
|
||||||
print "{}.value {}".format(member, lag)
|
print "{0}.value {1}".format(member, lag)
|
||||||
|
|
||||||
def config():
|
def config():
|
||||||
print """graph_title MongoDB replication lag
|
print """graph_title MongoDB replication lag
|
||||||
|
|
Loading…
Reference in a new issue