WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] xen usage monitoring (munin plugin)

On Sat, Jan 07 '06 at 21:44, tatu@xxxxxxxxx wrote:
> >as my Xen3 server is finaly becomming ready for production I was
> >wondering if anyone has written a xen usage monitoring/logging tool?
> 
> funny you should ask, I wrote one yesterday :)

I have written a simmilar script, in sh not in perl:

------------------------------------------------------------------------
#!/bin/sh
#
# Script to monitor CPU usage of Xen domains
#
# Parameters understood:
#
#     conifg    (required)
#     autoconf  (optinal - used by munin-config)
#

MAXDOMAINS=16

if [ "$1" = "autoconf" ]; then
        if which xm > /dev/null ; then
                echo yes
                exit 0
        fi
        echo "no (xm not found)"
        exit 1
fi

if [ "$1" = "config" ]; then

        echo 'graph_title Xen Domain Utilerisation'
        echo 'graph_args --base 1000 -l 0'
        echo 'graph_scale no'
        echo 'graph_vlable mS'
        echo 'graph_category xen'
        echo 'graph_info This graph shows of many mS wall time where used by a d
omain'
        xm list | grep -v "^Name .* Console$" | \
        while read name domid mem cpu state time console; do
                name=`echo $name | sed -e"s/-/_/"`
                echo "$name.label $name"
                echo "$name.type COUNTER"
#               if [ "$name" = "Domain_0" ]; then
#                       echo "$name.draw AREA"
#               else
#                       echo "$name.draw STACK"
#               fi
                echo "$name.min 0"
                echo "$name.info Wall clock time spend for $name"
        done
        exit 0
fi

        xm list | grep -v "^Name .* Console$" | \
        while read name domid mem cpu state time console; do
                name=`echo $name | sed -e"s/-/_/"`
                echo "$name.label $name"
                echo "$name.type COUNTER"
#               if [ "$name" = "Domain_0" ]; then
#                       echo "$name.draw AREA"
#               else
#                       echo "$name.draw STACK"
#               fi
                echo "$name.min 0"
                echo "$name.info Wall clock time spend for $name"
        done
        exit 0
fi

xm list | grep -v "^Name .* Console$" | \
while read name domid mem cpu state time console; do
        name=`echo $name | sed -e"s/-/_/"`
        time=`echo $time | sed -e "s/\.//"`
        echo "$name.value $time"
done
------------------------------------------------------------------------

But I'm not too proud of it. Unlike your version it:
- multiplies time by 10. So the comment is wrong, it's not mS but deca S
  or 10th of mS
- it should be able to handle adding/removing of domains

Still I would prefere it if it would log the actuall utilerisation, not
some "strange" CPU Time dirivat. Espcially as the values logged by my
plugin are in the 0.01 .. 0.22 range, with peeks at 1.72 (for this week)
or 5.19 (for the last year), and this is after multiplication by 10 as
done my the script.
-- 
Goetz Bock       (c) 2006 as     blacknet.de - Munich - Germany   /"\
IT Consultant  Creative Commons  secure mobile Linux everNETting  \ /
                                                                   X
 ASCII Ribbon Campaign against HTML email & microsoft attachments / \

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users