Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/xen/xen_vbd | ||
|---|---|---|
| 16 | 16 |
$XM = '/usr/sbin/xm'; |
| 17 | 17 |
$XMTOP = '/usr/sbin/xentop'; |
| 18 | 18 |
|
| 19 |
# ah, parameters coming in
|
|
| 19 |
# ah, parameters coming in |
|
| 20 | 20 |
if ( defined($ARGV[0])) |
| 21 | 21 |
{
|
| 22 | 22 |
if ($ARGV[0] eq 'config') { $arg = 'config'; }
|
| 23 | 23 |
if ($ARGV[0] eq 'autoconf') { $arg = 'autoconf'; }
|
| 24 |
|
|
| 25 |
if ( $arg eq 'autoconf' )
|
|
| 24 |
|
|
| 25 |
if ( $arg eq 'autoconf' ) |
|
| 26 | 26 |
{
|
| 27 | 27 |
if ( -e $XM && -e $XMTOP ) |
| 28 | 28 |
{
|
| ... | ... | |
| 35 | 35 |
exit 0; |
| 36 | 36 |
} |
| 37 | 37 |
} |
| 38 |
|
|
| 38 |
|
|
| 39 | 39 |
if ( $arg eq 'config' ) |
| 40 | 40 |
{
|
| 41 | 41 |
%cnf = ( |
| ... | ... | |
| 45 | 45 |
'graph_category' => 'virtualization', |
| 46 | 46 |
'graph_info' => 'Display the I/O operations for each domain', |
| 47 | 47 |
); |
| 48 |
|
|
| 48 |
|
|
| 49 | 49 |
@domains = `$XM list`; |
| 50 | 50 |
shift(@domains); # we don't need the header line |
| 51 |
|
|
| 51 |
|
|
| 52 | 52 |
foreach $domain ( @domains ) |
| 53 | 53 |
{
|
| 54 | 54 |
($dom, undef) = split(/\s/, $domain); |
| 55 | 55 |
$dom =~ s/[-.]/_/g; |
| 56 |
|
|
| 56 |
|
|
| 57 | 57 |
$cnf{ $dom.'RD' . '.label' } = 'read';
|
| 58 | 58 |
$cnf{ $dom.'RD' . '.type' } = 'COUNTER';
|
| 59 | 59 |
$cnf{ $dom.'RD' . '.graph' } = 'no';
|
| 60 | 60 |
$cnf{ $dom.'RD' . '.cdef' } = $dom.'RD,8,*';
|
| 61 |
|
|
| 61 |
|
|
| 62 | 62 |
$cnf{ $dom.'WR' . '.label' } = $dom;
|
| 63 | 63 |
$cnf{ $dom.'WR' . '.type' } = 'COUNTER';
|
| 64 | 64 |
$cnf{ $dom.'WR' . '.negative' } = $dom.'RD';
|
| 65 | 65 |
$cnf{ $dom.'WR' . '.cdef' } = $dom.'WR,8,*';
|
| 66 |
|
|
| 66 |
|
|
| 67 | 67 |
if ( "$cnt" == "0" ) |
| 68 | 68 |
{
|
| 69 | 69 |
$cnf { "$dom" . '.draw' } = 'AREA';
|
| 70 | 70 |
} |
| 71 | 71 |
$cnt++; |
| 72 | 72 |
} |
| 73 |
|
|
| 73 |
|
|
| 74 | 74 |
foreach $key ( sort(keys(%cnf)) ) |
| 75 | 75 |
{
|
| 76 | 76 |
print "$key $cnf{$key}\n";
|
| 77 | 77 |
} |
| 78 | 78 |
exit 0; |
| 79 |
|
|
| 79 |
|
|
| 80 | 80 |
} |
| 81 | 81 |
} |
| 82 | 82 |
|
| ... | ... | |
| 98 | 98 |
{
|
| 99 | 99 |
$domain =~ s/^\s+//; |
| 100 | 100 |
@tmp = split(/\s+/, $domain); |
| 101 |
|
|
| 101 |
|
|
| 102 | 102 |
$domname = $tmp[0]; |
| 103 | 103 |
$domname =~ s/[-.]/_/g; |
| 104 | 104 |
$vbdrd = $tmp[14]; |
| 105 | 105 |
$vbdwr = $tmp[15]; |
| 106 |
|
|
| 106 |
|
|
| 107 | 107 |
$vals{$domname."RD"}{'value'} = $vbdrd;
|
| 108 | 108 |
$vals{$domname."WR"}{'value'} = $vbdwr;
|
| 109 | 109 |
} |
| ... | ... | |
| 112 | 112 |
{
|
| 113 | 113 |
print "$key.value " . ($vals{$key}{'value'}) . "\n";
|
| 114 | 114 |
} |
| 115 |
|
|
| 115 |
|
|
Formats disponibles : Unified diff