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

lxc_ram: unify whitespace

This commit is contained in:
Lars Kruse 2018-06-10 14:47:00 +02:00
parent a49b362e35
commit 937ed37dae

View File

@ -51,9 +51,9 @@ areastack=${areastack:-false}
guest_names=$(lxc-ls | sort -u) guest_names=$(lxc-ls | sort -u)
for guest in $guest_names; do for guest in $guest_names; do
if lxc-info -n "$guest" 2>&1 | grep -qs RUNNING ; then if lxc-info -n "$guest" 2>&1 | grep -qs RUNNING ; then
active="$active $guest" active="$active $guest"
fi fi
done done
guest_names="$active" guest_names="$active"
@ -61,74 +61,66 @@ guest_names="$active"
f_comm='lxc-cgroup ' f_comm='lxc-cgroup '
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r /proc/stat ]; then if [ -r /proc/stat ]; then
echo yes echo yes
else else
echo "no (no /proc/stat)" echo "no (no /proc/stat)"
fi fi
exit 0 exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo 'graph_title Memory '
echo 'graph_args -l 0 --base 1024'
echo 'graph_vlabel byte'
echo 'graph_category memory'
echo 'graph_title Memory ' if [ "$areastack" = "true" ]; then
echo 'graph_args -l 0 --base 1024' for guest_name in $guest_names; do
echo 'graph_vlabel byte' guest="$(clean_fieldname "$guest_name")"
echo 'graph_category memory' echo "mem_usage_$guest.label $guest_name: Mem usage"
echo "mem_usage_$guest.type GAUGE"
echo "mem_usage_$guest.draw AREASTACK"
done
if [ "$areastack" = "true" ]; then for guest_name in $guest_names; do
for guest_name in $guest_names; do guest="$(clean_fieldname "$guest_name")"
guest="$(clean_fieldname "$guest_name")" echo "mem_cache_$guest.label $guest_name: Cache"
echo "mem_cache_$guest.type GAUGE"
echo "mem_usage_$guest.label $guest_name: Mem usage" echo "mem_active_$guest.label $guest_name: Active"
echo "mem_usage_$guest.type GAUGE" echo "mem_active_$guest.type GAUGE"
echo "mem_usage_$guest.draw AREASTACK" echo "mem_inactive_$guest.label $guest_name: Inactive"
done echo "mem_inactive_$guest.type GAUGE"
done
for guest_name in $guest_names; do else
guest="$(clean_fieldname "$guest_name")" for guest_name in $guest_names; do
guest="$(clean_fieldname "$guest_name")"
echo "mem_cache_$guest.label $guest_name: Cache" echo "mem_usage_$guest.label $guest_name: Mem usage"
echo "mem_cache_$guest.type GAUGE" echo "mem_usage_$guest.type GAUGE"
echo "mem_active_$guest.label $guest_name: Active" echo "mem_cache_$guest.label $guest_name: Cache"
echo "mem_active_$guest.type GAUGE" echo "mem_cache_$guest.type GAUGE"
echo "mem_inactive_$guest.label $guest_name: Inactive" echo "mem_active_$guest.label $guest_name: Active"
echo "mem_inactive_$guest.type GAUGE" echo "mem_active_$guest.type GAUGE"
echo "mem_inactive_$guest.label $guest_name: Inactive"
done echo "mem_inactive_$guest.type GAUGE"
else done
for guest_name in $guest_names; fi
do exit 0
guest="$(clean_fieldname "$guest_name")"
echo "mem_usage_$guest.label $guest_name: Mem usage"
echo "mem_usage_$guest.type GAUGE"
echo "mem_cache_$guest.label $guest_name: Cache"
echo "mem_cache_$guest.type GAUGE"
echo "mem_active_$guest.label $guest_name: Active"
echo "mem_active_$guest.type GAUGE"
echo "mem_inactive_$guest.label $guest_name: Inactive"
echo "mem_inactive_$guest.type GAUGE"
done
fi
exit 0
fi fi
for guest_name in $guest_names; do for guest_name in $guest_names; do
guest="$(clean_fieldname "$guest_name")" guest="$(clean_fieldname "$guest_name")"
value=$($f_comm -n "$guest_name" memory.usage_in_bytes) value=$($f_comm -n "$guest_name" memory.usage_in_bytes)
echo "mem_usage_$guest.value $value" echo "mem_usage_$guest.value $value"
value=$($f_comm -n "$guest_name" memory.stat | grep total_cache | awk '{print($2)}') value=$($f_comm -n "$guest_name" memory.stat | grep total_cache | awk '{print($2)}')
echo "mem_cache_$guest.value $value" echo "mem_cache_$guest.value $value"
value=$($f_comm -n "$guest_name" memory.stat | grep total_active_anon | awk '{print($2)}') value=$($f_comm -n "$guest_name" memory.stat | grep total_active_anon | awk '{print($2)}')
echo "mem_active_$guest.value $value" echo "mem_active_$guest.value $value"
value=$($f_comm -n "$guest_name" memory.stat | grep total_inactive_anon | awk '{print($2)}') value=$($f_comm -n "$guest_name" memory.stat | grep total_inactive_anon | awk '{print($2)}')
echo "mem_inactive_$guest.value $value" echo "mem_inactive_$guest.value $value"
done done