Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added openvz_ support for laverage and status #267

Merged
merged 1 commit into from

2 participants

@Harvie

No description provided.

@kenyon
Collaborator

Clever use of function definition. :smile:

@kenyon kenyon merged commit 2a31f93 into munin-monitoring:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2013
  1. @Harvie
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 plugins/openvz/openvz_
View
7 plugins/openvz/openvz_
@@ -36,7 +36,12 @@ if [ "$1" = "config" ]; then
exit 0
fi
-vzlist -a -H -o hostname,$ATTRIBUTE | awk '{gsub(/\./,"_",$1)
+filter() { cat; }
+[ "$ATTRIBUTE" = 'laverage' ] && filter() { sed -e 's/[0-9\.]*\/\(.*\)\/.*$/\1/g'; }
+[ "$ATTRIBUTE" = 'status' ] && filter() { sed -e 's/running/10/g;s/stopped/0/g'; }
+#TODO: filter for uptime
+
+vzlist -a -H -o hostname,$ATTRIBUTE | filter | awk '{gsub(/\./,"_",$1)
print("'$ATTRIBUTE'"$1".value "$2)}'
exit 0
Something went wrong with that request. Please try again.