mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Plugin lxc: simplify processing in function "active_guests"
This commit is contained in:
parent
9cdea3c305
commit
6413375cdc
1 changed files with 2 additions and 4 deletions
|
@ -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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue