1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51: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 # --- FUNCTIONS
function active_guests { function active_guests {
local guest_name active i ok local guest_name i ok
for guest_name in $(lxc-ls | sort -u) for guest_name in $(lxc-ls | sort -u)
do do
# handle optional exclude list in $1 # handle optional exclude list in $1
@ -109,12 +109,10 @@ function active_guests {
if [ "$ok" = 1 ]; then if [ "$ok" = 1 ]; then
if lxc-info -n "$guest_name" 2>&1 | grep -qs RUNNING; then if lxc-info -n "$guest_name" 2>&1 | grep -qs RUNNING; then
active="$active $guest_name" echo "$guest_name"
fi fi
fi fi
done done
echo "$active"
} }