mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Added some documentation and handling of RIAK_URL environment variable.
This commit is contained in:
parent
994980d233
commit
0eedb04aac
2 changed files with 24 additions and 2 deletions
|
@ -1,8 +1,19 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
|
||||||
|
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
|
||||||
|
# sample config in /etc/munin/plugin-conf.d/riak
|
||||||
|
#
|
||||||
|
# [riak_*]
|
||||||
|
# RIAK_URL=http://127.0.0.1:8091/stats
|
||||||
|
# any questions to fygrave at o0o dot nu
|
||||||
|
#
|
||||||
|
# This plugin monitors memory allocation on each node.
|
||||||
|
#
|
||||||
|
|
||||||
import urllib2
|
import urllib2
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
|
@ -13,7 +24,7 @@ except ImportError:
|
||||||
names = ["memory_total","memory_processes","memory_processes_used","memory_system","memory_atom","memory_atom_used","memory_binary","memory_code","memory_ets"]
|
names = ["memory_total","memory_processes","memory_processes_used","memory_system","memory_atom","memory_atom_used","memory_binary","memory_code","memory_ets"]
|
||||||
|
|
||||||
def getServerStatus():
|
def getServerStatus():
|
||||||
raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
|
raw = urllib2.urlopen( os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
|
||||||
return json.loads( raw )
|
return json.loads( raw )
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
|
||||||
|
# sample config in /etc/munin/plugin-conf.d/riak
|
||||||
|
#
|
||||||
|
# [riak_*]
|
||||||
|
# RIAK_URL=http://127.0.0.1:8091/stats
|
||||||
|
# any questions to fygrave at o0o dot nu
|
||||||
|
#
|
||||||
|
# This plugin monitors put/get rate at each node.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
import urllib2
|
import urllib2
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
|
@ -13,7 +24,7 @@ except ImportError:
|
||||||
names = ["node_gets_total", "node_puts_total"]
|
names = ["node_gets_total", "node_puts_total"]
|
||||||
|
|
||||||
def getServerStatus():
|
def getServerStatus():
|
||||||
raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
|
raw = urllib2.urlopen( os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
|
||||||
return json.loads( raw )
|
return json.loads( raw )
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue