mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Merge pull request #305 from dsavineau/master
Fix indexcounters and globallock in 2.2 and 2.4 version btree sub-document has been removed in 2.4 : http://docs.mongodb.org/manual/reference/command/serverStatus/#serverStatus.indexCounters ratio sub-document has been removed in 2.2 http://docs.mongodb.org/manual/reference/command/serverStatus/#serverStatus.globalLock.ratio
This commit is contained in:
commit
dc75b52a7d
@ -16,6 +16,10 @@ def getServerStatus():
|
||||
return json.loads( raw )["serverStatus"]
|
||||
|
||||
def get():
|
||||
status = getServerStatus()
|
||||
if status["version"] >= "2.4.0":
|
||||
return getServerStatus()["indexCounters"]
|
||||
else:
|
||||
return getServerStatus()["indexCounters"]["btree"]
|
||||
|
||||
def doData():
|
||||
|
@ -18,7 +18,12 @@ def getServerStatus():
|
||||
name = "locked"
|
||||
|
||||
def doData():
|
||||
print name + ".value " + str( 100 * getServerStatus()["globalLock"]["ratio"] )
|
||||
status = getServerStatus()
|
||||
if status["version"] >= "2.2.0":
|
||||
ratio = status["globalLock"]["lockTime"] / status["globalLock"]["totalTime"]
|
||||
else:
|
||||
ratio = status["globalLock"]["ratio"]
|
||||
print name + ".value " + str( 100 * ratio )
|
||||
|
||||
def doConfig():
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user