3
edits
Changes
Wikified (at least some more), added reference to another plugin, which uses vzlist
[[Category: Monitoring]]
== "Simple" munin plugin ==
The plugin listed below grabs all the beancounters' values.
if [ "$1" = "suggest" ]; then
if [ -r /proc/bc/0/resources ]; then
cat /proc/bc/0/resources |
while read str; do
vals=($str)
echo ${vals[0]}
done
exit 0
else
fi
fi
if [ "$1" = "config" ]; then
# echo "graph_order down up"
echo "graph_title $ATTR beancounter for containers"
echo 'graph_category system'
echo "graph_info 'Containers beancounters info'"
for CTID in `ls -d1 /proc/bc/???`; do
fi;
</source>
Put it with the munin plugins and make a link for every
if [ "$1" = "suggest" ]; then
if [ -r /proc/bc/0/resources ]; then
cat /proc/bc/0/resources |
while read str; do
vals=($str)
echo ${vals[0]}
done
exit 0
else
if [ "$1" = "config" ]; then
# echo "graph_order down up"
echo "graph_title beancounter for CT$ATTR: $STATS"
readme="false"
cat /proc/user_beancounters | while read myid stuff; do
line=""
if [ "$myid" == "$ATTR:" ]; then
readme="true"
line="$stuff"
echo $line
else
loid=`echo $myid | sed -e 's/.*:/:/'`
if [ "$loid" == ":" ]; then
readme="false"
fi
if [ "$readme" == "true" ]; then
line="$myid $stuff"
echo $line
fi
fi
done | while read name value top warn max; do
okname="dummy"
for statname in $STATS; do
if [ "$name" == "$statname" ]; then
okname=$name
fi
done
if [ "$okname" != "dummy" ]; then
echo $okname.label $name
echo $okname.warning $warn
fi
done
exit 0
fi;
readme="false"
cat /proc/user_beancounters | while read myid stuff; do
line=""
if [ "$myid" == "$ATTR:" ]; then
readme="true"
line="$stuff"
echo $line
else
loid=`echo $myid | sed -e 's/.*:/:/'`
if [ "$loid" == ":" ]; then
readme="false"
fi
if [ "$readme" == "true" ]; then
line="$myid $stuff"
echo $line
fi
done | while read name value x; do
okname="dummy"
for statname in $STATS; do
if [ "$name" == "$statname" ]; then
okname=$name
fi
done
if [ "$okname" != "dummy" ]; then
echo $okname.value $value
fi
done
</source>
== Another Extended plugin from Jan Tomasek ==
Jan has posted another plugin on http://forum.openvz.org/index.php?t=msg&goto=15122, where I've fixed two things:
<source lang="bash">
</source>
= Munin plugin setup =
== Run as root ==
Please note, you have to configure plugin to run as root. Therefore, add the following to /etc/munin/plugin-conf.d/ somewhere:
[vebc*]
user root
== Installing the plugins ==
There's a single plugin file, which can be installed several times and can put several values into the same graph.
You should install the plugin from above to e.g. <code>/usr/local/share/munin/plugins/vebc_</code> and then put symlinks to there from /etc/munin/plugins.
The following script allows you to handle this easily:
To install this, you can use the following script:
<source lang="bash">
rm $FILE
</source>
= Notes =
== Another plugin, using vzlist ==
There is another plugin available at http://muninexchange.projects.linpro.no/?view&phid=249 - using vzlist and PHP.
Especially using "vzlist" to only gather the requested fields might be a faster approach.