Hi,
Here’s a script that I thought might be useful for
everyone using Xen.
In order to monitor and log CPU utlisation of all domains, I
have implemented the following Perl script:
http://phplens.com/xenstat.pl.txt
Example usage:
===========
[Domain-0~]# perl xenstat.pl
cpus=2
54_garuda_0 0.49% cpu usage 3034.56 sec over 3.61 days
59_gyrfalcon 3.65% cpu usage 5032.13 sec over 0.80 days
Domain-0 1.56% cpu usage 9746.05 sec over 3.61 days
2009-09-29 10:38:12 39 1 37 23
2009-09-29 10:38:17 80 0 7 13
2009-09-29 10:38:22 54 0 4 42
2009-09-29 10:38:28 25 1 3 71
Where statistics is:
DATE TIME GARUDA GYRFALCON DOM0 IDLE
CPU% CPU% CPU% CPU%
2009-09-29 10:38:12 39 1 37 23
REST-ful Logging
=============
The other nice feature is that xenstat.pl can generate a URL
and if you have wget installed
It will send the URL to a web server:
[root@server ~]# perl xenstat.pl 10 1 http://192.168.0.1/
Which will call the following url once after 10 seconds of
monitoring the CPU:
http://192.168.0.1/?54_garuda_0=0&59_gyrfalcon=2&Domain%2D0=2&
For more complete documentation, see
http://phplens.com/phpeverywhere/?q=node/view/266
Regards, John Lim
jlim#natsoft.com