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

@ -11,7 +11,7 @@ Any system running squid and avialable cache_object://
=head1 CONFIGURATION
The following environment settings are the default configuration.
The following environment settings are the default configuration.
[squid]
env.squidhost localhost
@ -82,9 +82,9 @@ _
return sprintf($r_text, $squid_host, $what, &make_auth_header());
}
sub make_auth_header
sub make_auth_header
{
if(defined $squid_passwd && $squid_passwd ne "")
if(defined $squid_passwd && $squid_passwd ne "")
{
my $h_text = <<_;
Authorization: Basic %s
@ -99,22 +99,22 @@ _
sub squid_requst
{
my $what = $_[0];
die "Could not connect: $!\n" unless my $cachemgr = IO::Socket::INET->new(PeerAddr => $squid_host,
PeerPort => $squid_port,
Proto => 'tcp',
die "Could not connect: $!\n" unless my $cachemgr = IO::Socket::INET->new(PeerAddr => $squid_host,
PeerPort => $squid_port,
Proto => 'tcp',
Timeout => $squid_request_timeout);
my $request = &make_request($what);
$cachemgr->syswrite($request, length($request));
return $cachemgr;
}
if($ARGV[0] and $ARGV[0] eq "autoconf")
if($ARGV[0] and $ARGV[0] eq "autoconf")
{
if (squid_requst('menu')->getline ne "") { print "yes\n"; }
exit 0;
}
if($ARGV[0] and $ARGV[0] eq "config")
if($ARGV[0] and $ARGV[0] eq "config")
{
my %config;
# ------------------------------------------------- squid_efficiency_ -----------------------------------------
@ -349,7 +349,7 @@ my $cm;
my %data;
# ----------------- squid_efficiency_ and squid_memory --------------------
$cm = squid_requst('info');
while (my $line = $cm->getline)
while (my $line = $cm->getline)
{
# ----------------- squid_efficiency_ --------------------
if($line =~ /Hits as % of all requests:.*/) { ($data{'squid_efficiency_5'}{'all'}, $data{'squid_efficiency_60'}{'all'}) = $line =~ /([\d.]+)%/g; next; }
@ -392,7 +392,7 @@ while (my $line = $cm->getline)
# ----------------- squid_ipcache --------------------
$cm = squid_requst('ipcache');
while (my $line = $cm->getline)
while (my $line = $cm->getline)
{
if($line =~ /IPcache Entries:.*/) { $data{'squid_ipcache'}{'entries'} = ($line =~ /(\d+)/g)[0]; next; }
if($line =~ /IPcache Requests:.*/) { $data{'squid_ipcache'}{'request'} = ($line =~ /(\d+)/g)[0]; next; }

View file

@ -51,7 +51,7 @@
#
# [squid_efficiency]
# env.squidhost yourhost.example.com
# env.squidport 8080
# env.squidport 8080
#
host=${squidhost:-localhost}

View file

@ -4,7 +4,7 @@
# License GPL V2 or higher
#
# Abstract
# munin plugin that logs the cache mean services times
# munin plugin that logs the cache mean services times
# Requires netcat (here nc)
#
# Authors
@ -19,7 +19,7 @@ port=${squidport:-3128}
if [ "$1" = "autoconf" ]; then
SQUID_STATS=`printf "GET cache_object://$host/info HTTP/1.0\n\n" | netcat $host $port`
if [ -n "${SQUID_STATS}" ]; then
echo yes
echo yes
exit 0
else
echo "no (HTTP GET failed)"
@ -35,7 +35,7 @@ if [ "$1" = "config" ]; then
echo 'graph_vlabel median response times (s)'
echo 'mean_http.label Http'
echo 'mean_cmis.label Cache misses'
echo 'mean_cmis.label Cache misses'
echo 'mean_chits.label Cache hits'
echo 'mean_nhits.label Near hits'
echo 'mean_nmr.label Not-modified replies'
@ -43,7 +43,7 @@ if [ "$1" = "config" ]; then
echo 'mean_icpq.label Icp queries'
exit 0
fi
fi
SQUID_TIME=$(printf "GET cache_object://$host/info HTTP/1.0\n\n" | nc $host $port)
@ -57,7 +57,7 @@ SQUID_TIME_ICP_QUERIES=$(echo "$SQUID_TIME" | grep "ICP Queries" | cut -d':' -f2
echo "mean_http.value $SQUID_TIME_HTTP"
echo "mean_cmis.value $SQUID_TIME_CACHE_MISSES"
echo "mean_chits.value $SQUID_TIME_CACHE_HITS"
echo "mean_chits.value $SQUID_TIME_CACHE_HITS"
echo "mean_nhits.value $SQUID_TIME_NEAR_HITS"
echo "mean_nmr.value $SQUID_TIME_NM_REPLIES"
echo "mean_dnsl.value $SQUID_TIME_DNS_LOOKUPS"