mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +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
|
||||
# stacked area charts (changes graph
|
||||
# order) -- defaults to false
|
||||
# env.ram_areastack true
|
||||
# env.ram_display_stacked true
|
||||
|
||||
# lxc container path, default below
|
||||
#env.lxcpath /var/lib/lxc
|
||||
|
@ -84,6 +84,8 @@ or GPLv3 license or later, at your option
|
|||
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||
|
||||
lxcpath=${lxcpath:-/var/lib/lxc}
|
||||
ram_display_stacked=${ram_display_stacked:-false}
|
||||
|
||||
|
||||
# --- FUNCTIONS
|
||||
|
||||
|
@ -307,15 +309,16 @@ EOF
|
|||
|
||||
for n in $active_guests
|
||||
do
|
||||
cat <<EOF
|
||||
$(clean_fieldname "mem_usage__${n}").label ${n}: Mem usage
|
||||
$(clean_fieldname "mem_usage__${n}").type GAUGE
|
||||
EOF
|
||||
if [ "$areastack" = "true" ]; then
|
||||
echo $(clean_fieldname "mem_usage__${n}").draw AREASTACK
|
||||
if [ "$ram_display_stacked" = "true" ]; then
|
||||
draw_style="AREASTACK"
|
||||
else
|
||||
draw_style="LINE1"
|
||||
fi
|
||||
|
||||
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}").type GAUGE
|
||||
$(clean_fieldname "mem_active__${n}").label ${n}: Active
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue