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

lxc_ram: simplify quoting

This commit is contained in:
Lars Kruse 2018-06-10 14:35:12 +02:00
parent 76ddb809a5
commit 8a5b34c9c8

View File

@ -74,20 +74,20 @@ if [ "$1" = "config" ]; then
for guest_name in $guest_names; do
guest="$(clean_fieldname $guest_name)"
echo 'mem_usage_'$guest'.label '$guest_name': Mem usage'
echo 'mem_usage_'$guest'.type GAUGE'
echo 'mem_usage_'$guest'.draw AREASTACK'
echo "mem_usage_$guest.label $guest_name: Mem usage"
echo "mem_usage_$guest.type GAUGE"
echo "mem_usage_$guest.draw AREASTACK"
done
for guest_name in $guest_names; do
guest="$(clean_fieldname $guest_name)"
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'
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
else
@ -95,14 +95,14 @@ if [ "$1" = "config" ]; then
do
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'
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
@ -116,18 +116,18 @@ fi
guest="$(clean_fieldname $guest_name)"
tmp_v=`$f_comm -n $guest_name memory.usage_in_bytes`
echo 'mem_usage_'$guest'.value '$tmp_v
echo "mem_usage_$guest.value $tmp_v"
tmp_g=`$f_comm -n $guest_name memory.stat | grep total_cache`
tmp_v=`echo $tmp_g | awk '{print($2)}'`
echo 'mem_cache_'$guest'.value '$tmp_v
echo "mem_cache_$guest.value $tmp_v"
tmp_g=`$f_comm -n $guest_name memory.stat | grep total_active_anon`
tmp_v=`echo $tmp_g | awk '{print($2)}'`
echo 'mem_active_'$guest'.value '$tmp_v
echo "mem_active_$guest.value $tmp_v"
tmp_g=`$f_comm -n $guest_name memory.stat | grep total_inactive_anon`
tmp_v=`echo $tmp_g | awk '{print($2)}'`
echo 'mem_inactive_'$guest'.value '$tmp_v
echo "mem_inactive_$guest.value $tmp_v"
done