Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 57 lines (50 sloc) 1.886 kB
#!/bin/sh
#
# Wildcard-plugin to monitor Java JMX (http://java.sun.com/jmx)attributes.
# To monitor a # specific set of JMX attributes,
# link <config_name> to this file. E.g.
#
# ln -s /usr/share/plugins/jmx_ /etc/munin/plugins/jmx_java_threads
#
# ...will monitor Java thread count, assuming java_threads.conf file is located in
# /etc/munin/plugins folder.
#
# For Java process to be monitored, it must expose JMX remote interface.
# With Java 1.5 it can be done by adding parameters as:
#
# -Dcom.sun.management.jmxremote.port=<PORT> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
#
# For Tomcat to be monitored, add the following line in catalina.bat script:
# set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=<PORT> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
#
# By default, the plugin monitors localhost on <PORT> = 1616 using URL
# service:jmx:rmi:///jndi/rmi://localhost:1616/jmxrmi
# with no authentication credentials
# It can be changed by specifying parameters in /etc/munin/plugin-conf.d/munin-node
#
# [jmx_*]
# env.jmxurl service:jmx:rmi:///jndi/rmi://localhost:1616/jmxrmi
# env.jmxuser monitorRole
# env.jmxpass QED
#
# Read more on JMX configuring at http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
# $Log$
#
LINK=`readlink $0`
CONFIGNAME=`basename $0 | sed 's/^jmx_//g'`.conf
RDIR=`dirname $LINK`
if [ "$jmxurl" = "" ]; then
SERVICE=service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi
else
SERVICE="$jmxurl"
fi
if [ "$jmxuser" != "" ]; then
CREDS="--user=$jmxuser --pass=$jmxpass"
fi
# checks
test -z $CONFIGNAME || test -z "$RDIR" && exit 1
JMXQUERY="java -jar $RDIR/jmxquery.jar --url=$SERVICE $CREDS --conf=$RDIR/$CONFIGNAME"
case $1 in
(config) $JMXQUERY config;;
(*) $JMXQUERY ;;
esac
Jump to Line
Something went wrong with that request. Please try again.