mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing mongo repl set lag munin graph.
This commit is contained in:
parent
05a6dd2bab
commit
5d6c2ba9aa
3 changed files with 7 additions and 4 deletions
|
@ -23,7 +23,7 @@ class MongoDBConnectionsPlugin(MuninMongoDBPlugin):
|
|||
value = status['connections']['current']
|
||||
except KeyError:
|
||||
value = "U"
|
||||
return dict(heap_usage=value)
|
||||
return dict(connections=value)
|
||||
|
||||
if __name__ == "__main__":
|
||||
MongoDBConnectionsPlugin().run()
|
||||
|
|
|
@ -28,10 +28,10 @@ class MongoReplicaSetLag(MuninMongoDBPlugin):
|
|||
member_state = member['state']
|
||||
optime = member['optime']
|
||||
if member_state == PRIMARY_STATE:
|
||||
primary_optime = optime.time
|
||||
primary_optime = optime
|
||||
elif member_state == SECONDARY_STATE:
|
||||
if not oldest_secondary_optime or optime.time < oldest_secondary_optime.time:
|
||||
oldest_secondary_optime = optime.time
|
||||
if not oldest_secondary_optime or optime < oldest_secondary_optime:
|
||||
oldest_secondary_optime = optime
|
||||
|
||||
if not primary_optime or not oldest_secondary_optime:
|
||||
raise Exception("Replica set is not healthy")
|
||||
|
|
3
fabfile.py
vendored
3
fabfile.py
vendored
|
@ -1133,6 +1133,9 @@ def copy_munin_data(from_server):
|
|||
|
||||
|
||||
def setup_db_munin():
|
||||
sudo('rm /etc/munin/plugins/mongo*')
|
||||
sudo('rm /etc/munin/plugins/pg_*')
|
||||
sudo('rm /etc/munin/plugins/redis_*')
|
||||
sudo('cp -frs %s/config/munin/mongo* /etc/munin/plugins/' % env.NEWSBLUR_PATH)
|
||||
sudo('cp -frs %s/config/munin/pg_* /etc/munin/plugins/' % env.NEWSBLUR_PATH)
|
||||
sudo('cp -frs %s/config/munin/redis_* /etc/munin/plugins/' % env.NEWSBLUR_PATH)
|
||||
|
|
Loading…
Add table
Reference in a new issue