1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-26 10:58:12 +00:00

cleaned up, translated to english

This commit is contained in:
Michael Richter, Marian Sigler 2010-08-13 15:46:30 +02:00 committed by Steve Schnepp
parent 2d2d3d609f
commit cc0439f102

View file

@ -3,11 +3,14 @@
# Monitors memory usage in openVZ or Virtuozzo # Monitors memory usage in openVZ or Virtuozzo
# based on http://www.huschi.net/archiv/speicher-anzeigen-mit-vzfree.html # based on http://www.huschi.net/archiv/speicher-anzeigen-mit-vzfree.html
# Author: Michael Richter, http://osor.de/ # Author: Michael Richter, http://osor.de/
# Cleaned up and translated to english by: Marian Sigler <m@qjym.de>, 2010-08-13
# #
#%# capabilities=autoconf #%# capabilities=autoconf
BEANCOUNTERS=/proc/user_beancounters
if [ "$1" == "autoconf" ]; then if [ "$1" == "autoconf" ]; then
if [ -e /proc/user_beancounters ]; then if [ -e $BEANCOUNTERS ]; then
echo yes echo yes
exit 0 exit 0
else else
@ -16,46 +19,46 @@ if [ "$1" == "autoconf" ]; then
fi fi
fi fi
x=$(cat /proc/user_beancounters | grep privvmpages| awk 'BEGIN{ cur=max=bar=lim=fail=0; }{ cur+=$2; max+=$3;bar+=$4;lim+=$5;fail+=$6 } END {print cur*4*1024,max*4*1024,bar*4*1024,lim*4*1024,fail}') if [ ! -r $BEANCOUNTERS ]; then
echo "$BEANCOUNTERS not readable" >&2
momentan=$(echo $x| awk '{print $1}') exit 1
maximalgenutzt=$(echo $x| awk '{print $2}') fi
barriere=$(echo $x| awk '{print $3}')
maximalnutzbar=$(echo $x| awk '{print $4}')
fehler=$(echo $x| awk '{print $5}')
zu=$(cat /proc/user_beancounters | grep oomguarpages | awk 'BEGIN{ bar=0; }{ bar+=$4 } END { print bar*4*1024}')
zugesichert=$(echo $zu| awk '{print $1}')
if [ "$1" == "config" ]; then if [ "$1" == "config" ]; then
echo "graph_args --base 1024 -l 0 --vertical-label Speicher --upper-limit $maximalnutzbar"; limit=$(awk '/privvmpages/ {print $5*4096}' $BEANCOUNTERS)
echo "graph_title VPS Speichernutzung" cut -c9- <<EOF
echo "graph_category system" graph_args --base 1024 -l 0 --vertical-label bytes --upper-limit $limit
echo "graph_info Diese Grafik zeigt die Speichernutzung." graph_title VPS memory usage
echo "graph_order maximal momentan zugesichert barriere limit" graph_category system
graph_info Shows memory usage and VPS memory limits.
graph_order maxheld held oomguar barrier limit
echo "momentan.label Momentan" held.label held
echo "momentan.draw AREA" held.draw AREA
echo "momentan.info Aktueller Speicherverbrauch" held.info currently held memory
echo "maximal.label Maximal" maxheld.label maxheld
echo "maximal.draw AREA" maxheld.draw AREA
echo "maximal.info Maximaler Speicherverbrauch" maxheld.info maximum held memory
echo "zugesichert.label Zugesichert" oomguar.label guaranteed
echo "zugesichert.draw LINE2" oomguar.draw LINE2
echo "zugesichert.info Zugesicherter Speicher" oomguar.info memory guaranteed for OOM
echo "barriere.label Barriere" barrier.label barrier
echo "barriere.draw LINE2" barrier.draw LINE2
echo "barriere.info Maximal erlaubter Speicher" barrier.info memory usage barrier
echo "limit.label Limit" limit.label limit
echo "limit.draw LINE2" limit.draw LINE2
echo "limit.info Maximal nutzbarer Speicher" limit.info memory usage limit
EOF
exit 0 exit 0
fi fi
echo "momentan.value $momentan" if [ $# -gt 0 ]; then
echo "maximal.value $maximalgenutzt" echo "Invalid argument: $1" >&2
echo "zugesichert.value $zugesichert" exit 1
echo "barriere.value $barriere" fi
echo "limit.value $maximalnutzbar"
awk '/privvmpages/ {print "held.value", $2*4096 "\nmaxheld.value", $3*4096 "\nbarrier.value", $4*4096 "\nlimit.value", $5*4096}' $BEANCOUNTERS
awk '/oomguarpages/ { print "oomguar.value", $4*4096 }' $BEANCOUNTERS