mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Riak node puts/gets monitoring
This commit is contained in:
parent
3b371ba0fe
commit
85d8571b3e
47
plugins/other/riak_node
Executable file
47
plugins/other/riak_node
Executable file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
|
||||
import urllib2
|
||||
import sys
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
|
||||
names = ["node_gets_total", "node_puts_total"]
|
||||
|
||||
def getServerStatus():
|
||||
raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
|
||||
return json.loads( raw )
|
||||
|
||||
|
||||
|
||||
def doData():
|
||||
for name in names:
|
||||
print name + ".value " + str( getServerStatus()[name] )
|
||||
|
||||
def doConfig():
|
||||
|
||||
print "graph_title Riak puts and gets"
|
||||
print "graph_args --base 1000 -l 0"
|
||||
print "graph_vlabel puts/gets"
|
||||
print "graph_category Riak"
|
||||
|
||||
for name in names:
|
||||
print name + ".label " + name
|
||||
print name + ".min 0"
|
||||
print name + ".type COUNTER"
|
||||
print name + ".max 500000"
|
||||
print name + "draw LINE1"
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
doConfig()
|
||||
else:
|
||||
doData()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user