Permalink
Browse files

updated docs,

query param required
  • Loading branch information...
1 parent 0e4a490 commit 8c39a19c6a3f918bf9e60de4dc01130555e8de71 @tcurdt committed Apr 12, 2011
Showing with 29 additions and 17 deletions.
  1. +28 −15 README.md
  2. +0 −1 contrib/jmx2munin.sh
  3. +1 −1 src/main/java/org/vafer/jmx/munin/Munin.java
View
@@ -9,25 +9,39 @@ Some of it's features:
# How to use
-This is what Munin will call. So you should test this first. Of course with your parameters. This example expose all Cassandra information to Munin.
+This is what the Munin script will call. So you should test this first. Of course with your parameters. This example expose all Cassandra information to Munin.
+
+ java -jar jmx2munin.jar \
+ -url service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi \
+ -query "org.apache.cassandra.*:*"
+
+The "url" parameters specifies the JMX URL, the query selects the MBeans (and optionally also the attributes) to expose.
java -jar jmx2munin.jar \
-url service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi \
-query "org.apache.cassandra.*:*" \
- -config /path/to/plugin.cfg \
+ -attribute org_apache_cassandra_db_storageservice_livenodes_size
+
+The script that does the actual interaction with munin you can find in the contrib section. It's the one you should link in the your Munin plugin directory.
+
+ :/etc/munin/plugins$ ls -la cassandra_*
+ lrwxrwxrwx 1 root root 37 2011-04-07 19:58 cassandra_nodes_in_cluster -> /usr/share/munin/plugins/jmx2munin.sh
+
+In the plugin conf you point to the correct configuration
+
+ [cassandra_*]
+ env.query org.apache.cassandra.*:*
+
+ [cassandra_nodes_in_cluster]
+ env.config cassandra/nodes_in_cluster
+
+A possible configuration could look like this
-The "url" parameters specifies the JMX URL, the query selects the MBean to expose and the config points to the Munin plugin configuration. Something along the lines of:
+ graph_title Number of Nodes in Cluster
+ graph_vlabel org_apache_cassandra_db_storageservice_livenodes_size
+ org_apache_cassandra_db_storageservice_livenodes_size.label number of nodes
- graph_title Load average
- graph_args --base 1000 -l 0
- graph_vlabel load
- graph_scale no
- graph_category system
- load.label load
- load.warning 10
- load.critical 120
- graph_info The load average.
- load.info Average load for the five minutes.
+The script will extract the attributes from the config and caches the JMX results to reduce the load when showing many values.
# More advanced
@@ -50,12 +64,11 @@ It should output a list of possible candidates. This can now be turned into a en
6 = ^Starting drain
7 = ^Node is drained
-Which we then provide:
+Which you then can provide:
java -jar jmx2munin.jar \
-url service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi \
-query "org.apache.cassandra.*:*" \
- -config /path/to/plugin.cfg \
-enums /path/to/enums.cfg
Now matching values get replaced by their numerical representation. On the left needs to be a unique number on the right side is a regular expression. If a string cannot be matched according to the spec "U" for "undefined" will be returned.
View
@@ -50,7 +50,6 @@ fi
ATTRIBUTES=`awk '/\.label/ { gsub(/\.label/,""); print $1 }' $CONFIG`
-# big room for improvement here
for ATTRIBUTE in $ATTRIBUTES; do
grep $ATTRIBUTE $CACHED
done
@@ -21,7 +21,7 @@
@Parameter(names = "-url", description = "jmx url", required = true)
private String url;
- @Parameter(names = "-query", description = "query expression")
+ @Parameter(names = "-query", description = "query expression", required = true)
private String query;
@Parameter(names = "-enums", description = "file string to enum config")

0 comments on commit 8c39a19

Please sign in to comment.