mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Simplify graph logic, don't use a multigraph
This commit is contained in:
parent
1199e0d04b
commit
6f7f6a096a
1 changed files with 4 additions and 18 deletions
|
@ -41,17 +41,8 @@ def run():
|
||||||
primary_optime = members[member]['optimeDate']
|
primary_optime = members[member]['optimeDate']
|
||||||
|
|
||||||
for member in members:
|
for member in members:
|
||||||
members[member]['lag'] = (primary_optime - members[member]['optimeDate']).seconds
|
lag = (primary_optime - members[member]['optimeDate']).seconds
|
||||||
|
print "{}.value {}".format(member, lag)
|
||||||
print "multigraph mongodb_replication_lag"
|
|
||||||
for member in members:
|
|
||||||
print "{}_lag.value {}".format(member, members[member]['lag'])
|
|
||||||
print
|
|
||||||
|
|
||||||
for member in members:
|
|
||||||
print "multigraph mongodb_replication_lag.{}".format(member)
|
|
||||||
print "lag.value {}".format(members[member]['lag'])
|
|
||||||
print
|
|
||||||
|
|
||||||
def config():
|
def config():
|
||||||
print """graph_title MongoDB replication lag
|
print """graph_title MongoDB replication lag
|
||||||
|
@ -59,14 +50,9 @@ graph_args --base 1000
|
||||||
graph_vlabel Replication lag (seconds)
|
graph_vlabel Replication lag (seconds)
|
||||||
graph_category MongoDB
|
graph_category MongoDB
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for member in _get_members():
|
for member in _get_members():
|
||||||
print "{0}_lag.label {0}".format(member)
|
print "{0}.label {0}".format(member)
|
||||||
print "{}_lag.type GAUGE".format(member)
|
|
||||||
print "{}_lag.info Replication lag behind master".format(member)
|
|
||||||
print "{}_lag.min 0".format(member)
|
|
||||||
print "{}_lag.draw LINE1".format(member)
|
|
||||||
print
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue