1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 09:57:09 +00:00

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -9,7 +9,7 @@ Configuration variables (/etc/munin/plugin-conf.d/):
host_name - Name of you ESXi host as defined in munin.conf
timeout - Plugin specific timeout
Plugin specific:
env.esxi_host - (REQUIRED) hostname/ip esxcli connect to
env.esxi_host - (REQUIRED) hostname/ip esxcli connect to
env.esxi_user - (REQUIRED) ESXi username to connect
env.esxi_password - (REQUIRED) password for user given above
env.cache_file - path to cache file (we do not want two or more sequential reconnections to ESXi host)

View file

@ -30,7 +30,7 @@ function get_vmlist () {
vmlist_linenumber="$(echo "$summary" | $GREP -n "^Vmid")"
vmlist_linenumber="${vmlist_linenumber/:*/}"
vmlist="$(echo "$summary" | $TAIL -n $(($total_linenumber - $vmlist_linenumber)) | tr -s " ")"
}
@ -74,7 +74,7 @@ function VMoverallCpuUsage () {
temp="${c/*overallCpuUsage = /}"
vmcpu[$n]="${temp/,*/}"
if [ "${vmcpu[$n]}" == "<unset>" ]; then
vmcpu[$n]="0"
vmcpu[$n]="0"
fi
(( n++ ))
done <<EOF
@ -89,7 +89,7 @@ function VMoverallGuestMemUsage () {
temp="${m/*guestMemoryUsage = /}"
vmmem[$n]="${temp/,*/}"
if [ "${vmmem[$n]}" == "<unset>" ]; then
vmmem[$n]="0"
vmmem[$n]="0"
fi
(( n++ ))
done <<EOF
@ -104,7 +104,7 @@ function VMoverallHostMemUsage () {
temp="${m/*hostMemoryUsage = /}"
vmmem[$n]="${temp/,*/}"
if [ "${vmmem[$n]}" == "<unset>" ]; then
vmmem[$n]="0"
vmmem[$n]="0"
fi
(( n++ ))
done <<EOF

View file

@ -60,7 +60,7 @@ Phil Gold <phil_g@pobox.com>
To the extent possible under law, the author(s) have dedicated all copyright and
related and neighboring rights to this software to the public domain worldwide
under a CC0 waiver. This software is distributed without any warranty.
under a CC0 waiver. This software is distributed without any warranty.
http://creativecommons.org/publicdomain/zero/1.0/

View file

@ -63,37 +63,37 @@ my @lines=split(/\n/,$output);
if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
my $lcount = 0;
my $base_config = "graph_category virtualization\n";
if( $type eq "pcpu" ) {
print $base_config;
print "graph_args --base 1000 -l 0 -u 100 -r\n";
print "graph_scale no\n";
print "graph_args --base 1000 -l 0 -u 100 -r\n";
print "graph_scale no\n";
print "graph_title CPU usage in % per VM\n";
print "graph_vlabel % of CPU usage\n";
print "graph_info The Graph shows the CPU usage in % per VM\n";
print "graph_info The Graph shows the CPU usage in % per VM\n";
foreach my $line(@lines) {
if( $line =~ /(?<!grep)$/) {
if( $line =~ /(?<!grep)$/) {
my @vm = ();
my $count = 0;
my @array=split(/ /,$line);
my @array=split(/ /,$line);
foreach my $entry(@array) {
if( length($entry) > 2 ){
$vm[$count]=$entry;
$count++;
}
}
}
$vm[3] =~ s/\.vmx//;
my $cat = clean_vmname($vm[3]);
my $cat = clean_vmname($vm[3]);
if( $cat =~ /(?<!comm)$/) {
if( $lcount > 0 ){
print $cat,"_pcpu.draw STACK\n";
} else {
print $cat,"_pcpu.draw AREA\n";
}
$lcount++;
$lcount++;
print $cat,"_pcpu.label $vm[3]\n";
print $cat,"_pcpu.type GAUGE\n";
}
}
}
}
}
@ -104,64 +104,64 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
print "graph_scale no\n";
print "graph_title Memory usage in % per VM\n";
print "graph_vlabel % of Memory usage\n";
print "graph_info The Graph shows the Memory usage in % per VM\n";
print "graph_info The Graph shows the Memory usage in % per VM\n";
foreach my $line(@lines) {
if( $line =~ /(?<!grep)$/ ) {
if( $line =~ /(?<!grep)$/ ) {
my @vm = ();
my $count = 0;
my @array=split(/ /,$line);
foreach my $entry(@array) {
if( length($entry) > 2 ){
$vm[$count]=$entry;
$count++;
}
}
$vm[3] =~ s/\.vmx//;
my $cat = clean_vmname($vm[3]);
if( $cat =~ /(?<!comm)$/) {
if( $lcount > 0 ){
print $cat,"_pmem.draw STACK\n";
} else {
print $cat,"_pmem.draw AREA\n";
}
$lcount++;
print $cat,"_pmem.label $vm[3]\n";
print $cat,"_pmem.type GAUGE\n";
}
}
}
}
if( $type eq "mem" ) {
print $base_config;
print "graph_args --base 1024 -r --lower-limit 0\n";
print "graph_title absolute Memory usage per VM\n";
print "graph_vlabel Memory usage\n";
print "graph_info The Graph shows the absolute Memory usage per VM\n";
foreach my $line(@lines) {
if( $line =~ /(?<!grep)$/ ) {
my @vm = ();
my $count = 0;
my @array=split(/ /,$line);
my @array=split(/ /,$line);
foreach my $entry(@array) {
if( length($entry) > 2 ){
$vm[$count]=$entry;
$count++;
}
}
$vm[3] = clean_vmname($vm[3]);
if( $vm[3] =~ /(?<!comm)$/) {
$vm[3] =~ s/\.vmx//;
my $cat = clean_vmname($vm[3]);
if( $cat =~ /(?<!comm)$/) {
if( $lcount > 0 ){
print $cat,"_pmem.draw STACK\n";
} else {
print $cat,"_pmem.draw AREA\n";
}
$lcount++;
print $cat,"_pmem.label $vm[3]\n";
print $cat,"_pmem.type GAUGE\n";
}
}
}
}
if( $type eq "mem" ) {
print $base_config;
print "graph_args --base 1024 -r --lower-limit 0\n";
print "graph_title absolute Memory usage per VM\n";
print "graph_vlabel Memory usage\n";
print "graph_info The Graph shows the absolute Memory usage per VM\n";
foreach my $line(@lines) {
if( $line =~ /(?<!grep)$/ ) {
my @vm = ();
my $count = 0;
my @array=split(/ /,$line);
foreach my $entry(@array) {
if( length($entry) > 2 ){
$vm[$count]=$entry;
$count++;
}
}
$vm[3] = clean_vmname($vm[3]);
if( $vm[3] =~ /(?<!comm)$/) {
if( $lcount > 0 ){
print "$vm[3]_mem.draw STACK\n";
} else {
print "$vm[3]_mem.draw AREA\n";
}
print "$vm[3]_mem.label $vm[3]\n";
print "$vm[3]_mem.type GAUGE\n";
$lcount++;
}
print "$vm[3]_mem.type GAUGE\n";
$lcount++;
}
}
}
}
}
} else {
@ -169,7 +169,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
if( $line =~ /(?<!grep)$/ ) {
my @vm = ();
my $count = 0;
my @array=split(/ /,$line);
my @array=split(/ /,$line);
foreach my $entry(@array) {
if( length($entry) > 2 ){
$vm[$count]=$entry;
@ -177,7 +177,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
}
}
$vm[3] = clean_vmname($vm[3]);
if( $vm[3] =~ /(?<!comm)$/) {
if( $vm[3] =~ /(?<!comm)$/) {
if( $type eq "pcpu" ) {
print "$vm[3]_pcpu.value $vm[0]\n";
}
@ -190,7 +190,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
}
}
}
}
}
}
sub clean_vmname {

View file

@ -17,13 +17,13 @@ if [ "$1" = "config" ]; then
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Load of VMware VMs'
echo 'graph_category cpu'
while [ $i -lt ${#VMX[*]} ]
do
NAME=`vmware-cmd "${VMX[i]}" getconfig displayName |sed 's!getconfig(displayName) = !!' | sed 's! !!g' | sed 's!-!_!g'`
echo $NAME.label $NAME
i=`expr $i + 1`
done
exit 0