Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix nodetool path, add default config

  • Loading branch information...
commit 428d2744d480240c795d14d2d98897bf6c5a3f76 1 parent 5f965d8
@mag- authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 munin/cassandra.py
View
7 munin/cassandra.py
@@ -15,10 +15,13 @@ class MuninCassandraPlugin(MuninPlugin):
def __init__(self, *args, **kwargs):
super(MuninCassandraPlugin, self).__init__(*args, **kwargs)
- self.nodetool_path = os.environ["NODETOOL_PATH"]
+ self.nodetool_path = os.environ.get("NODETOOL_PATH")
+ if self.nodetool_path==None:
+ self.nodetool_path = "nodetool"
self.host = socket.gethostname()
self.keyspaces = [x for x in os.environ.get('CASSANDRA_KEYSPACE', '').split(',') if x]
-
+ if self.keyspaces==None:
+ self.keyspaces = ["system"]
def execute_nodetool(self, cmd):
p = Popen([self.nodetool_path, "-host", self.host, cmd], stdout=PIPE)
output = p.communicate()[0]
Please sign in to comment.
Something went wrong with that request. Please try again.