2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Added openvz_ support for laverage and status

This commit is contained in:
Tomas Mudrunka 2013-03-07 08:51:18 +01:00
parent ccaeefff42
commit a80bc90c49

View File

@ -36,7 +36,12 @@ if [ "$1" = "config" ]; then
exit 0 exit 0
fi 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)}' print("'$ATTRIBUTE'"$1".value "$2)}'
exit 0 exit 0