1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Plugin lxc: simplify processing in function "active_guests"

This commit is contained in:
Lars Kruse 2019-08-12 00:56:24 +02:00
parent 9cdea3c305
commit 6413375cdc

View file

@ -95,7 +95,7 @@ cgrouppath=${cgrouppath:-}
# --- FUNCTIONS
function active_guests {
local guest_name active i ok
local guest_name i ok
for guest_name in $(lxc-ls | sort -u)
do
# handle optional exclude list in $1
@ -109,12 +109,10 @@ function active_guests {
if [ "$ok" = 1 ]; then
if lxc-info -n "$guest_name" 2>&1 | grep -qs RUNNING; then
active="$active $guest_name"
echo "$guest_name"
fi
fi
done
echo "$active"
}