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

@ -37,7 +37,7 @@ EOF
if [ "$1" = "autoconf" ]; then
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
awk 'BEGIN { ev=1; }
/^precision:/ { ev=0; }
/^precision:/ { ev=0; }
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
exit 0
fi

View file

@ -35,9 +35,9 @@ None known
EOF
if [ "$1" = "autoconf" ]; then
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
awk 'BEGIN { ev=1; }
/^frequency tolerance:/ { ev=0; }
/^frequency tolerance:/ { ev=0; }
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
exit 0
fi

View file

@ -39,7 +39,7 @@
#
# Change log
# v1.0.0 2008-07-21 Chris Hastie
# initial release
# initial release
#
# v1.1.0 2010-12-07 Uffe Norberg
# - Changed default statedir to /var/lib/munin/plugin-state (Debian default)
@ -107,7 +107,7 @@ open(SERVICE, "$COMMAND |")
while (<SERVICE>) {
if (/^[-+*#](\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\s+\S+){7}\s+(\S+)/) {
my $name = &lookupname($1);
$peers{$1}{'value'} = $3;
$peers{$1}{'value'} = $3;
}
}
close(SERVICE);
@ -140,7 +140,7 @@ foreach my $peer (keys %peers) {
# save list of peer IPs and hostnames
if(-l $statefile) {
die("$statefile is a symbolic link, refusing to touch it.");
}
}
open (OUT, ">$statefile") or exit 4;
foreach my $i (keys %peers) {
print OUT "$i:" . $peers{$i}{'name'} . "\n";
@ -155,12 +155,12 @@ sub by_name {
# create a valid munin field name from the hostname
sub sanitize_field () {
my $field = shift;
# replace illegal characters with an underscore
$field =~ s/[^A-Za-z0-9_]/_/g;
# prepend an underscore if name starts with a number
$field =~ s/^([^A-Za-z_])/_$1/;
# truncate to 19 characters
if (length($field) > 19) {
$field = substr($field, 0, 19);
@ -181,11 +181,11 @@ sub lookupname () {
my $ip = shift;
# have we already got it?
if ($peers{$ip}{'name'}) {
return $peers{$ip}{'name'};
return $peers{$ip}{'name'};
}
# else look it up
my $iaddr = inet_aton($ip);
my $name = gethostbyaddr($iaddr, AF_INET) || $ip;
my $iaddr = inet_aton($ip);
my $name = gethostbyaddr($iaddr, AF_INET) || $ip;
# add to cache
$peers{$ip}{'name'} = $name;
return $name;

View file

@ -29,7 +29,7 @@
#
# Change log
# v1.0.0 2008-07-21 Chris Hastie
# initial release
# initial release
# v1.0.1 2009-06-05 Tony Hoyle
# ipv6 support. Remove dns lookups.
#
@ -75,7 +75,7 @@ open(SERVICE, "$COMMAND |")
while (<SERVICE>) {
if(/^\s*\d+\s+(\d+)\s+/) {
my ($name, $offset) = &lookupip($1);
$peers{$name} = $offset;
$peers{$name} = $offset;
}
}
close(SERVICE);
@ -106,12 +106,12 @@ foreach my $peer (keys %peers) {
# create a valid munin field name from the hostname
sub sanitize_field () {
my $field = shift;
# replace illegal characters with an underscore
$field =~ s/[^A-Za-z0-9_]/_/g;
# prepend an underscore if name starts with a number
$field =~ s/^([^A-Za-z_])/_$1/;
# truncate to 19 characters
if (length($field) > 19) {
$field = substr($field, 0, 19);

View file

@ -5,7 +5,7 @@
=head1 NAME
ntp_pool_score_ - Wildcard plugin to monitor the score assigned to a server
ntp_pool_score_ - Wildcard plugin to monitor the score assigned to a server
from pool.ntp.org . This is achieved by fetching the cvs data from
http://www.pool.ntp.org/scores/IP_ADDRESS/log?limit=1 using wget.
@ -38,7 +38,7 @@ tocho AT tochev DOT net
=head1 LICENSE
GNU General Public License, version 2
http://www.gnu.org/licenses/gpl-2.0.html
http://www.gnu.org/licenses/gpl-2.0.html
=head1 MAGIC MARKERS

View file

@ -27,7 +27,7 @@
#
# Change log
# v1.0.0 2009-03-11 Chris Hastie
# initial release
# initial release
#
#
#
@ -86,20 +86,19 @@ while (<SERVICE>) {
}
if (/^bad version:\s*(\d*)/) {
$queries += $1;
}
}
# if (/^access denied:\s*(\d*)/) {
# $queries += $1;
# }
# }
# if (/^bad length or format:\s*(\d*)/) {
# $queries += $1;
# }
# }
# if (/^bad authentication:\s*(\d*)/) {
# $queries += $1;
# }
# }
# if (/^rate exceeded:\s*(\d*)/) {
# $queries += $1;
# }
# }
}
close(SERVICE);