Révision 38ed4d0f
Support for XEN-Domains with an dot in their name
| plugins/other/xen | ||
|---|---|---|
| 3 | 3 |
# Script to monitor CPU usage of Xen domains |
| 4 | 4 |
# |
| 5 | 5 |
# Author: unknown |
| 6 |
# Modifications: Matthias Pfafferodt, syntron@web.de |
|
| 6 |
# Modifications: Matthias Pfafferodt, syntron@web.de, Roland Mohrbacher
|
|
| 7 | 7 |
# License: GPL v. 2 |
| 8 | 8 |
# |
| 9 | 9 |
# Parameters understood: |
| ... | ... | |
| 34 | 34 |
|
| 35 | 35 |
echo 'graph_title Xen Domain Utilerisation' |
| 36 | 36 |
echo 'graph_args --base 1000 -l 0 --upper-limit 100 --rigid' |
| 37 |
# echo 'graph_scale no'
|
|
| 37 |
echo 'graph_scale no' |
|
| 38 | 38 |
echo 'graph_vlabel %' |
| 39 | 39 |
echo 'graph_category xen' |
| 40 | 40 |
echo 'graph_info This graph shows how many % of the CPU time where used by a domain' |
| 41 | 41 |
|
| 42 | 42 |
xm list | grep -v "^Name .* Time(s)$" | \ |
| 43 | 43 |
while read name domid mem cpu state time console; do |
| 44 |
name=`echo $name | sed -e"s/-/_/"`
|
|
| 44 |
name=`echo $name | sed -e"s/[-.]/_/g"`
|
|
| 45 | 45 |
TEST=`less $statefile | grep "^${name}$" | wc -l`
|
| 46 | 46 |
if [ $TEST -ne 1 ]; then |
| 47 | 47 |
echo "$name" >> $statefile |
| ... | ... | |
| 68 | 68 |
|
| 69 | 69 |
xm list | grep -v "^Name .* Time(s)$" | \ |
| 70 | 70 |
while read name domid mem cpu state time console; do |
| 71 |
name=`echo $name | sed -e "s/-/_/"`
|
|
| 71 |
name=`echo $name | sed -e "s/[-.]/_/g"`
|
|
| 72 | 72 |
# only seconds |
| 73 | 73 |
time=`echo $time | sed -e "s/\..//"` |
| 74 | 74 |
# scale 60s/60s => 100%/60s |
Formats disponibles : Unified diff