Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/vmware/fusion_ | ||
|---|---|---|
| 63 | 63 |
if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
|
| 64 | 64 |
my $lcount = 0; |
| 65 | 65 |
my $base_config = "graph_category virtualization\n"; |
| 66 |
|
|
| 66 |
|
|
| 67 | 67 |
if( $type eq "pcpu" ) {
|
| 68 | 68 |
print $base_config; |
| 69 |
print "graph_args --base 1000 -l 0 -u 100 -r\n";
|
|
| 70 |
print "graph_scale no\n";
|
|
| 69 |
print "graph_args --base 1000 -l 0 -u 100 -r\n"; |
|
| 70 |
print "graph_scale no\n"; |
|
| 71 | 71 |
print "graph_title CPU usage in % per VM\n"; |
| 72 | 72 |
print "graph_vlabel % of CPU usage\n"; |
| 73 |
print "graph_info The Graph shows the CPU usage in % per VM\n";
|
|
| 73 |
print "graph_info The Graph shows the CPU usage in % per VM\n"; |
|
| 74 | 74 |
foreach my $line(@lines) {
|
| 75 |
if( $line =~ /(?<!grep)$/) {
|
|
| 75 |
if( $line =~ /(?<!grep)$/) {
|
|
| 76 | 76 |
my @vm = (); |
| 77 | 77 |
my $count = 0; |
| 78 |
my @array=split(/ /,$line);
|
|
| 78 |
my @array=split(/ /,$line); |
|
| 79 | 79 |
foreach my $entry(@array) {
|
| 80 | 80 |
if( length($entry) > 2 ){
|
| 81 | 81 |
$vm[$count]=$entry; |
| 82 | 82 |
$count++; |
| 83 | 83 |
} |
| 84 |
}
|
|
| 84 |
} |
|
| 85 | 85 |
$vm[3] =~ s/\.vmx//; |
| 86 |
my $cat = clean_vmname($vm[3]);
|
|
| 86 |
my $cat = clean_vmname($vm[3]); |
|
| 87 | 87 |
if( $cat =~ /(?<!comm)$/) {
|
| 88 | 88 |
if( $lcount > 0 ){
|
| 89 | 89 |
print $cat,"_pcpu.draw STACK\n"; |
| 90 | 90 |
} else {
|
| 91 | 91 |
print $cat,"_pcpu.draw AREA\n"; |
| 92 | 92 |
} |
| 93 |
$lcount++;
|
|
| 93 |
$lcount++; |
|
| 94 | 94 |
print $cat,"_pcpu.label $vm[3]\n"; |
| 95 | 95 |
print $cat,"_pcpu.type GAUGE\n"; |
| 96 |
}
|
|
| 96 |
} |
|
| 97 | 97 |
} |
| 98 | 98 |
} |
| 99 | 99 |
} |
| ... | ... | |
| 104 | 104 |
print "graph_scale no\n"; |
| 105 | 105 |
print "graph_title Memory usage in % per VM\n"; |
| 106 | 106 |
print "graph_vlabel % of Memory usage\n"; |
| 107 |
print "graph_info The Graph shows the Memory usage in % per VM\n";
|
|
| 107 |
print "graph_info The Graph shows the Memory usage in % per VM\n"; |
|
| 108 | 108 |
foreach my $line(@lines) {
|
| 109 |
if( $line =~ /(?<!grep)$/ ) {
|
|
| 109 |
if( $line =~ /(?<!grep)$/ ) {
|
|
| 110 | 110 |
my @vm = (); |
| 111 | 111 |
my $count = 0; |
| 112 |
my @array=split(/ /,$line);
|
|
| 112 |
my @array=split(/ /,$line); |
|
| 113 | 113 |
foreach my $entry(@array) {
|
| 114 | 114 |
if( length($entry) > 2 ){
|
| 115 | 115 |
$vm[$count]=$entry; |
| 116 | 116 |
$count++; |
| 117 | 117 |
} |
| 118 |
}
|
|
| 118 |
} |
|
| 119 | 119 |
$vm[3] =~ s/\.vmx//; |
| 120 |
my $cat = clean_vmname($vm[3]);
|
|
| 120 |
my $cat = clean_vmname($vm[3]); |
|
| 121 | 121 |
if( $cat =~ /(?<!comm)$/) {
|
| 122 | 122 |
if( $lcount > 0 ){
|
| 123 | 123 |
print $cat,"_pmem.draw STACK\n"; |
| 124 | 124 |
} else {
|
| 125 | 125 |
print $cat,"_pmem.draw AREA\n"; |
| 126 | 126 |
} |
| 127 |
$lcount++;
|
|
| 127 |
$lcount++; |
|
| 128 | 128 |
print $cat,"_pmem.label $vm[3]\n"; |
| 129 | 129 |
print $cat,"_pmem.type GAUGE\n"; |
| 130 |
}
|
|
| 130 |
} |
|
| 131 | 131 |
} |
| 132 |
}
|
|
| 132 |
} |
|
| 133 | 133 |
} |
| 134 | 134 |
|
| 135 | 135 |
if( $type eq "mem" ) {
|
| 136 | 136 |
print $base_config; |
| 137 |
print "graph_args --base 1024 -r --lower-limit 0\n";
|
|
| 137 |
print "graph_args --base 1024 -r --lower-limit 0\n"; |
|
| 138 | 138 |
print "graph_title absolute Memory usage per VM\n"; |
| 139 | 139 |
print "graph_vlabel Memory usage\n"; |
| 140 |
print "graph_info The Graph shows the absolute Memory usage per VM\n";
|
|
| 140 |
print "graph_info The Graph shows the absolute Memory usage per VM\n"; |
|
| 141 | 141 |
foreach my $line(@lines) {
|
| 142 |
if( $line =~ /(?<!grep)$/ ) {
|
|
| 142 |
if( $line =~ /(?<!grep)$/ ) {
|
|
| 143 | 143 |
my @vm = (); |
| 144 | 144 |
my $count = 0; |
| 145 |
my @array=split(/ /,$line);
|
|
| 145 |
my @array=split(/ /,$line); |
|
| 146 | 146 |
foreach my $entry(@array) {
|
| 147 | 147 |
if( length($entry) > 2 ){
|
| 148 | 148 |
$vm[$count]=$entry; |
| 149 | 149 |
$count++; |
| 150 | 150 |
} |
| 151 | 151 |
} |
| 152 |
$vm[3] = clean_vmname($vm[3]);
|
|
| 153 |
if( $vm[3] =~ /(?<!comm)$/) {
|
|
| 152 |
$vm[3] = clean_vmname($vm[3]); |
|
| 153 |
if( $vm[3] =~ /(?<!comm)$/) {
|
|
| 154 | 154 |
if( $lcount > 0 ){
|
| 155 | 155 |
print "$vm[3]_mem.draw STACK\n"; |
| 156 | 156 |
} else {
|
| 157 | 157 |
print "$vm[3]_mem.draw AREA\n"; |
| 158 | 158 |
} |
| 159 | 159 |
print "$vm[3]_mem.label $vm[3]\n"; |
| 160 |
print "$vm[3]_mem.type GAUGE\n";
|
|
| 161 |
$lcount++;
|
|
| 162 |
}
|
|
| 160 |
print "$vm[3]_mem.type GAUGE\n"; |
|
| 161 |
$lcount++; |
|
| 162 |
} |
|
| 163 | 163 |
} |
| 164 |
}
|
|
| 164 |
} |
|
| 165 | 165 |
} |
| 166 | 166 |
|
| 167 | 167 |
} else {
|
| ... | ... | |
| 169 | 169 |
if( $line =~ /(?<!grep)$/ ) {
|
| 170 | 170 |
my @vm = (); |
| 171 | 171 |
my $count = 0; |
| 172 |
my @array=split(/ /,$line);
|
|
| 172 |
my @array=split(/ /,$line); |
|
| 173 | 173 |
foreach my $entry(@array) {
|
| 174 | 174 |
if( length($entry) > 2 ){
|
| 175 | 175 |
$vm[$count]=$entry; |
| ... | ... | |
| 177 | 177 |
} |
| 178 | 178 |
} |
| 179 | 179 |
$vm[3] = clean_vmname($vm[3]); |
| 180 |
if( $vm[3] =~ /(?<!comm)$/) {
|
|
| 180 |
if( $vm[3] =~ /(?<!comm)$/) {
|
|
| 181 | 181 |
if( $type eq "pcpu" ) {
|
| 182 | 182 |
print "$vm[3]_pcpu.value $vm[0]\n"; |
| 183 | 183 |
} |
| ... | ... | |
| 190 | 190 |
} |
| 191 | 191 |
} |
| 192 | 192 |
} |
| 193 |
}
|
|
| 193 |
} |
|
| 194 | 194 |
} |
| 195 | 195 |
|
| 196 | 196 |
sub clean_vmname {
|
Formats disponibles : Unified diff