mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 22:25:23 +00:00
Plugin lxc: fix configurable RAM graphing
Previously (before the multigraph conversion) the configuration setting for "lxc_ram" was called "areastack". The multigraph conversion documented a new configuration setting "ram_areastack", but it was not used, yet. Thus we can switch to a more descriptive name: "ram_display_stacked".
This commit is contained in:
parent
d004990b21
commit
ab6f4e3c6e
1 changed files with 10 additions and 7 deletions
|
@ -15,7 +15,7 @@ lxc-multigraph - Plugin to monitor LXC containers (v2.0)
|
||||||
# memory usage of containers drawn as
|
# memory usage of containers drawn as
|
||||||
# stacked area charts (changes graph
|
# stacked area charts (changes graph
|
||||||
# order) -- defaults to false
|
# order) -- defaults to false
|
||||||
# env.ram_areastack true
|
# env.ram_display_stacked true
|
||||||
|
|
||||||
# lxc container path, default below
|
# lxc container path, default below
|
||||||
#env.lxcpath /var/lib/lxc
|
#env.lxcpath /var/lib/lxc
|
||||||
|
@ -84,6 +84,8 @@ or GPLv3 license or later, at your option
|
||||||
. $MUNIN_LIBDIR/plugins/plugin.sh
|
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||||
|
|
||||||
lxcpath=${lxcpath:-/var/lib/lxc}
|
lxcpath=${lxcpath:-/var/lib/lxc}
|
||||||
|
ram_display_stacked=${ram_display_stacked:-false}
|
||||||
|
|
||||||
|
|
||||||
# --- FUNCTIONS
|
# --- FUNCTIONS
|
||||||
|
|
||||||
|
@ -307,15 +309,16 @@ EOF
|
||||||
|
|
||||||
for n in $active_guests
|
for n in $active_guests
|
||||||
do
|
do
|
||||||
cat <<EOF
|
if [ "$ram_display_stacked" = "true" ]; then
|
||||||
$(clean_fieldname "mem_usage__${n}").label ${n}: Mem usage
|
draw_style="AREASTACK"
|
||||||
$(clean_fieldname "mem_usage__${n}").type GAUGE
|
else
|
||||||
EOF
|
draw_style="LINE1"
|
||||||
if [ "$areastack" = "true" ]; then
|
|
||||||
echo $(clean_fieldname "mem_usage__${n}").draw AREASTACK
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
$(clean_fieldname "mem_usage__${n}").label ${n}: Mem usage
|
||||||
|
$(clean_fieldname "mem_usage__${n}").type GAUGE
|
||||||
|
$(clean_fieldname "mem_usage__${n}").draw $draw_style
|
||||||
$(clean_fieldname "mem_cache__${n}").label ${n}: Cache
|
$(clean_fieldname "mem_cache__${n}").label ${n}: Cache
|
||||||
$(clean_fieldname "mem_cache__${n}").type GAUGE
|
$(clean_fieldname "mem_cache__${n}").type GAUGE
|
||||||
$(clean_fieldname "mem_active__${n}").label ${n}: Active
|
$(clean_fieldname "mem_active__${n}").label ${n}: Active
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue