mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -21,7 +21,7 @@ $ ln -s /path/to/plugin/greyfix /etc/munin/plugins/greyfix
|
|||
Configuration
|
||||
=============
|
||||
|
||||
There are some settings that can be tweaked by adding statements to the
|
||||
There are some settings that can be tweaked by adding statements to the
|
||||
munin-node config:
|
||||
|
||||
[greyfix]
|
||||
|
@ -36,10 +36,10 @@ env.num_steps 47
|
|||
# graph the greylisted triplets separate from the whitelisted ones (default: yes)
|
||||
env.greylist_step no
|
||||
|
||||
Please note that the last step has no end date, so it includes all triplets
|
||||
older than the second last step. I.e., the defaults (as named above) create a
|
||||
graph that shows 10 steps of one week each, and one last step for everything
|
||||
older than 10 weeks. Also, the separate greylist step is not considered
|
||||
Please note that the last step has no end date, so it includes all triplets
|
||||
older than the second last step. I.e., the defaults (as named above) create a
|
||||
graph that shows 10 steps of one week each, and one last step for everything
|
||||
older than 10 weeks. Also, the separate greylist step is not considered
|
||||
when applying num_steps.
|
||||
|
||||
"""
|
||||
|
@ -72,7 +72,7 @@ def greyfix_parse_triplets():
|
|||
if greyfix.returncode > 0:
|
||||
print '# greyfix exited with exit code %i' % (greyfix.returncode)
|
||||
sys.exit(greyfix.returncode)
|
||||
|
||||
|
||||
triplets = []
|
||||
for line in stdout.split("\n"):
|
||||
triplet = line.split("\t")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Munin plugin to monitor postfix-policyd-spf-python results
|
||||
# Contributed by Alexander Koch <lynix47@gmail.com>
|
||||
# Contributed by Alexander Koch <lynix47@gmail.com>
|
||||
#
|
||||
# This plugin is published under the terms of the MIT License.
|
||||
#
|
||||
#
|
||||
# Parameters understood:
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
#
|
||||
# Config variables:
|
||||
# logfile - Where to find the postfix log (mail.log)
|
||||
#
|
||||
|
|
|
@ -91,7 +91,7 @@ SPOOLDIR=${spooldir:-$POSTCONFSPOOL}
|
|||
|
||||
case $1 in
|
||||
autoconf|detect)
|
||||
|
||||
|
||||
if [ -d $SPOOLDIR ] ; then
|
||||
echo yes
|
||||
exit 0
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
# env.policy my policy string
|
||||
#
|
||||
# When env.policy is set, this plugin will match the string you supply as env.policy and return the number of instances
|
||||
# of that string as an output called "policy.value".
|
||||
# of that string as an output called "policy.value".
|
||||
#
|
||||
# If you are NOt using a postfix policy daemon, as above, use the line
|
||||
# If you are NOt using a postfix policy daemon, as above, use the line
|
||||
#
|
||||
# [postfix*]
|
||||
# env.policy none
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
|
||||
|
||||
POLICY=${policy}
|
||||
POLICY=${policy}
|
||||
|
||||
if [ "$POLICY" = "none" ]
|
||||
then POLICY=""
|
||||
|
@ -67,11 +67,11 @@ if [ "$1" = "config" ]; then
|
|||
echo 'allowed.label Allowed'
|
||||
echo 'allowed.min 0'
|
||||
echo 'allowed.type ABSOLUTE'
|
||||
|
||||
|
||||
echo 'rbl.label RBL blocked'
|
||||
echo 'rbl.min 0'
|
||||
echo 'rbl.type ABSOLUTE'
|
||||
|
||||
|
||||
if [ -z "$POLICY" ]
|
||||
then
|
||||
echo "empty" > /dev/null
|
||||
|
@ -84,15 +84,15 @@ if [ "$1" = "config" ]; then
|
|||
echo 'helo.label HELO rejected'
|
||||
echo 'helo.min 0'
|
||||
echo 'helo.type ABSOLUTE'
|
||||
|
||||
|
||||
echo 'client.label Client rejected'
|
||||
echo 'client.min 0'
|
||||
echo 'client.type ABSOLUTE'
|
||||
|
||||
|
||||
echo 'sender.label Sender rejected'
|
||||
echo 'sender.min 0'
|
||||
echo 'sender.type ABSOLUTE'
|
||||
|
||||
|
||||
echo 'recipient.label Recipient unknown'
|
||||
echo 'recipient.min 0'
|
||||
echo 'recipient.type ABSOLUTE'
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
# env.policy my policy string
|
||||
#
|
||||
# When env.policy is set, this plugin will match the string you supply as env.policy and return the number of instances
|
||||
# of that string as an output called "policy.value".
|
||||
# of that string as an output called "policy.value".
|
||||
#
|
||||
# If you are NOT using a postfix policy daemon, as above, use the line
|
||||
# If you are NOT using a postfix policy daemon, as above, use the line
|
||||
#
|
||||
# [postfix_filtered]
|
||||
# env.policy none
|
||||
|
@ -58,7 +58,7 @@ if [ "$1" = "config" ]; then
|
|||
if [ -z "$POLICY" ]
|
||||
then
|
||||
echo 'graph_order rbl helo client sender recipient relay allowed'
|
||||
|
||||
|
||||
else
|
||||
echo 'graph_order rbl policy helo client sender recipient relay allowed'
|
||||
echo 'policy.label policy blocked'
|
||||
|
@ -98,11 +98,11 @@ fi
|
|||
|
||||
|
||||
$LOGTAIL ${MAIL_LOG} $STATEFILE | \
|
||||
awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; ne= 0; nf= 0; ng= 0; nh= 0 ; st= ENVIRON["POLICY"] }
|
||||
awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; ne= 0; nf= 0; ng= 0; nh= 0 ; st= ENVIRON["POLICY"] }
|
||||
|
||||
{
|
||||
if (index($0, "queued as")) { na++ }
|
||||
else if (index($0, "Relay access denied")) { nb++ }
|
||||
{
|
||||
if (index($0, "queued as")) { na++ }
|
||||
else if (index($0, "Relay access denied")) { nb++ }
|
||||
else if (index($0, "blocked using")) { nc++ }
|
||||
else if (index($0, "Helo command rejected")) { nd++ }
|
||||
else if (index($0, "Client host rejected")) { ne++ }
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
|
||||
mktempfile () {
|
||||
mktemp -t
|
||||
}
|
||||
mktemp -t
|
||||
}
|
||||
|
||||
MAIL_LOG=${logfile:-/var/log/mail.log}
|
||||
LOGTAIL=${logtail:-`which logtail`}
|
||||
|
|
|
@ -171,7 +171,7 @@ foreach my $i (@status_list)
|
|||
|
||||
#if(-l $statefile) {
|
||||
# die("$statefile is a symbolic link, refusing to touch it.");
|
||||
#}
|
||||
#}
|
||||
#open (OUT, '>', $statefile) or die "Unable to open statefile: $!\n";
|
||||
#print OUT "sum:$sum\n";
|
||||
#foreach my $i (@status_list)
|
||||
|
@ -180,8 +180,8 @@ foreach my $i (@status_list)
|
|||
#}
|
||||
#close OUT;
|
||||
|
||||
sub parseLogfile
|
||||
{
|
||||
sub parseLogfile
|
||||
{
|
||||
my ($fname) = @_;
|
||||
|
||||
# the search parts
|
||||
|
|
|
@ -169,7 +169,7 @@ foreach my $i (sort keys %{$rejects})
|
|||
if (-l $statefile)
|
||||
{
|
||||
die ("$statefile is a symbolic link, refusing to touch it.");
|
||||
}
|
||||
}
|
||||
open (OUT, '>', $statefile) or die "Unable to open statefile: $!\n";
|
||||
print OUT "$pos:$delivered\n";
|
||||
foreach my $i (sort keys %{$rejects})
|
||||
|
@ -178,31 +178,31 @@ foreach my $i (sort keys %{$rejects})
|
|||
}
|
||||
close OUT;
|
||||
|
||||
sub parseLogfile
|
||||
{
|
||||
sub parseLogfile
|
||||
{
|
||||
my ($fname, $start, $stop) = @_;
|
||||
open (LOGFILE, $fname)
|
||||
or die "Unable to open logfile $fname for reading: $!\n";
|
||||
seek (LOGFILE, $start, 0)
|
||||
or die "Unable to seek to $start in $fname: $!\n";
|
||||
|
||||
while (tell (LOGFILE) < $stop)
|
||||
while (tell (LOGFILE) < $stop)
|
||||
{
|
||||
my $line = <LOGFILE>;
|
||||
chomp ($line);
|
||||
|
||||
if ($line =~ /$postfix\/qmgr.*from=.*size=[0-9]*/ ||
|
||||
$line =~ /$postfix\/smtp.* status=sent /)
|
||||
$line =~ /$postfix\/smtp.* status=sent /)
|
||||
{
|
||||
$delivered++;
|
||||
}
|
||||
}
|
||||
elsif ($line =~ /$postfix\/smtpd.*reject: \S+ \S+ \S+ (\S+)/ ||
|
||||
$line =~ /$postfix\/cleanup.* reject: (\S+)/)
|
||||
{
|
||||
$rejects->{$1}++;
|
||||
}
|
||||
}
|
||||
close(LOGFILE) or warn "Error closing $fname: $!\n";
|
||||
close(LOGFILE) or warn "Error closing $fname: $!\n";
|
||||
}
|
||||
|
||||
# vim:syntax=perl
|
||||
|
|
|
@ -145,7 +145,7 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf")
|
|||
print "no (logfile '$logfile' not found)\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print "no (postfix not found)\n";
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ if (!$pos)
|
|||
# No state file present. Avoid startup spike: Do not read log
|
||||
# file up to now, but remember how large it is now, and next
|
||||
# time read from there.
|
||||
|
||||
|
||||
$pos = (stat $logfile)[7]; # File size
|
||||
foreach $syslog_name (@postfix_syslog_name)
|
||||
{
|
||||
|
|
|
@ -21,11 +21,11 @@ There is no default configuration. This is an example config for Ubuntu:
|
|||
env.pflogsumm pflogsumm
|
||||
|
||||
env.logfiles contains space separated syslog logfiles, usually current log
|
||||
and previous log. You can add more log files if you want, but this may
|
||||
and previous log. You can add more log files if you want, but this may
|
||||
increase the time required for analysis.
|
||||
|
||||
env.pflogsumm The "pflogsumm" script, can be pflogsumm.pl if it was manually
|
||||
downloaded and installed, or "pflogsumm" if it was installed by a package
|
||||
downloaded and installed, or "pflogsumm" if it was installed by a package
|
||||
manager (like apt-get).
|
||||
|
||||
Use the last part of the symlink name for filtering by hostname from logfile,
|
||||
|
@ -136,7 +136,7 @@ else
|
|||
fi
|
||||
|
||||
# Parse value from Raw result
|
||||
#
|
||||
#
|
||||
# Return digit if regex are parsed correctly
|
||||
#
|
||||
# Return U (undefined) if any error occurs
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
|
||||
mktempfile () {
|
||||
mktemp -t
|
||||
}
|
||||
mktemp -t
|
||||
}
|
||||
|
||||
MAIL_LOG=${logfile:-/var/log/mail.log}
|
||||
STATEFILE=$MUNIN_PLUGSTATE/postgrey.offset
|
||||
|
@ -69,7 +69,7 @@ then
|
|||
fi
|
||||
|
||||
delayed=`grep 'Recipient address rejected.*Greylisted' ${TEMP_FILE} | wc -l`
|
||||
passed=`grep 'postgrey\[[0-9]*\]: delayed [0-9]* seconds:' ${TEMP_FILE} | wc -l`
|
||||
passed=`grep 'postgrey\[[0-9]*\]: delayed [0-9]* seconds:' ${TEMP_FILE} | wc -l`
|
||||
whitelisted=`grep 'postgrey\[[0-9]*\]: whitelisted:' ${TEMP_FILE} | wc -l`
|
||||
|
||||
/bin/rm -f $TEMP_FILE
|
||||
|
|
|
@ -62,7 +62,7 @@ if(defined $ARGV[0] and $ARGV[0] eq "config") {
|
|||
print "graph_category mail\n";
|
||||
print "graph_vlabel Count\n";
|
||||
print "graph_scale no\n";
|
||||
|
||||
|
||||
print "greylisted.label greylisted_reason_new\n";
|
||||
print "greylisted.type GAUGE\n";
|
||||
print "greylisted.draw AREA\n";
|
||||
|
@ -93,7 +93,7 @@ if( -f $statefile) {
|
|||
chomp($retry_old);
|
||||
chomp($passes_white_old);
|
||||
close STATE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -122,7 +122,7 @@ while(my $line = <LOG>)
|
|||
$passes_white++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue