#!/bin/sh : << =cut =head1 NAME lxc_net - Munin plugin to graph traffic of active LXC containers. =head1 APPLICABLE SYSTEMS LXC container with "lxc.network.type=veth" and "lxc.network.veth.pair" settings. =head1 CONFIGURATION env.lxcpath - Set the path where LXC containers are stored, default: /var/lib/lxc env.exclude - Removing containers from graphs, default: empty [lxc_net] env.lxcpath /var/lib/lxc env.exclude container1 container2 =head1 INTERPRETATION This plugin reads a "lxc.network.veth.pair" setting from "config" file of each container, because lxc-start command creates a random named veth device without the setting, which changes at each run. =head1 AUTHOR mitty mitty@mitty.jp (many changes schaefer@alphanet.ch) =head1 LICENSE 2-clause BSD License or GPLv3 license, at your option =head1 MAGIC MARKERS #%# family=auto #%# capabilities=autoconf =cut . $MUNIN_LIBDIR/plugins/plugin.sh . $MUNIN_LIBDIR/plugins/lxc-lib active_guests=$(active_guests $exclude) if [ "$1" = "autoconf" ]; then if [ ! -r /proc/net/dev ]; then echo "no (/proc/net/dev cannot be read)" exit 0 fi if [ ! -e "$lxcpath" ]; then echo "no ($lxcdir is not present)" exit 0 fi echo yes exit 0 fi if [ "$1" = "config" ]; then cat <