1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

Plugin lxc: simplify interface of "lxc_netdev"

This commit is contained in:
Lars Kruse 2019-08-12 00:40:15 +02:00
parent 89003f0188
commit 313d195f3b

View file

@ -132,8 +132,6 @@ function lxc_netdev {
(egrep '^lxc.net.0.veth.pair' "$lxcpath/$g/config" 2>/dev/null \ (egrep '^lxc.net.0.veth.pair' "$lxcpath/$g/config" 2>/dev/null \
|| egrep '^lxc.network.veth.pair' "$lxcpath/$g/config" || egrep '^lxc.network.veth.pair' "$lxcpath/$g/config"
) | awk '{print $NF;}' ) | awk '{print $NF;}'
else
echo unknown
fi fi
} }
@ -266,7 +264,7 @@ EOF
for n in $active_guests for n in $active_guests
do do
device=$(lxc_netdev "$n") device=$(lxc_netdev "$n")
if [ "$device" = "unknown" ]; then if [ -z "$device" ]; then
continue continue
fi fi
bps="U" bps="U"
@ -366,7 +364,7 @@ echo "multigraph lxc_net"
for n in $active_guests for n in $active_guests
do do
device=$(lxc_netdev "$n") device=$(lxc_netdev "$n")
if [ "$device" = "unknown" ]; then if [ -z "$device" ]; then
value_up="U" value_up="U"
value_down="U" value_down="U"
else else