Projet

Général

Profil

Révision 0eedb04a

ID0eedb04aac5cced2d4d045a17c9c93e1a007c437
Parent 994980d2
Enfant 5cc0fa32

Ajouté par Fyodor Yarochkin il y a presque 14 ans

Added some documentation and handling of RIAK_URL environment variable.

Voir les différences:

plugins/other/riak_node
1 1
#!/usr/bin/python
2 2

  
3
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
4
# sample config in /etc/munin/plugin-conf.d/riak
5
#
6
# [riak_*]
7
# RIAK_URL=http://127.0.0.1:8091/stats
8
# any questions to fygrave at o0o dot nu
9
#
10
# This plugin monitors put/get rate at each node.
11
#
12

  
3 13

  
4 14
import urllib2
5 15
import sys
16
import os
6 17

  
7 18
try:
8 19
    import json
......
13 24
names = ["node_gets_total", "node_puts_total"]
14 25

  
15 26
def getServerStatus():
16
    raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
27
    raw = urllib2.urlopen(  os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
17 28
    return json.loads( raw )
18 29

  
19 30

  

Formats disponibles : Unified diff