Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from gentoo/master

Couple of fixes from Gentoo
  • Loading branch information...
commit 6a239b396b95601d3b9d1c54ea9d6892fc9f1a03 2 parents 7352502 + bebcb29
@tcurdt authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 contrib/jmx2munin.sh
View
9 contrib/jmx2munin.sh
@@ -23,6 +23,8 @@ if [ -z "$url" ]; then
url="service:jmx:rmi:///jndi/rmi://127.0.0.1:7199/jmxrmi"
fi
+[ -z "$config" ] && config="${0#*_}"
+
if [ -z "$config" -o -z "$query" -o -z "$url" ]; then
echo "Configuration needs attributes config, query and optinally url"
exit 1
@@ -36,9 +38,8 @@ if [ "$1" = "config" ]; then
exit 0
fi
-JAR="$JMX2MUNIN_DIR/jmx2munin.jar"
-URLSUM=`echo -n "$url" | cksum | cut -d ' ' -f 1`
-CACHED="/tmp/jmx2munin.$URLSUM"
+JAR="$MUNIN_LIBDIR/jmx2munin.jar"
+CACHED="${MUNIN_STATEFILE}"
if test ! -f $CACHED || test `find "$CACHED" -mmin +2`; then
@@ -62,4 +63,4 @@ for ATTRIBUTE in $ATTRIBUTES; do
grep "$ATTRIBUTE\." $CACHED
done
-exit 0
+exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.