Skip to content
Browse files

filter on the cache not before caching

  • Loading branch information...
1 parent 2fdb385 commit 0e4a490d589403842f9ae7561496528046e5b233 @tcurdt committed Apr 8, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 contrib/jmx2munin.sh
View
9 contrib/jmx2munin.sh
@@ -39,8 +39,6 @@ CACHED="/tmp/jmx2munin"
if test ! -f $CACHED || test `find "$CACHED" -mmin +2`; then
- ATTRIBUTES=`awk '/\.label/ { gsub(/\.label/,""); printf "-attribute %s ", $1 }' $CONFIG`
-
java -jar "$JAR" \
-url "$url" \
-query "$query" \
@@ -50,4 +48,9 @@ if test ! -f $CACHED || test `find "$CACHED" -mmin +2`; then
echo "cached.value `date +%s`" >> $CACHED
fi
-cat $CACHED
+ATTRIBUTES=`awk '/\.label/ { gsub(/\.label/,""); print $1 }' $CONFIG`
+
+# big room for improvement here
+for ATTRIBUTE in $ATTRIBUTES; do
+ grep $ATTRIBUTE $CACHED
+done

0 comments on commit 0e4a490

Please sign in to comment.
Something went wrong with that request. Please try again.