packages: nagios-plugin-check_amavis/check_amavis.pl - tabs
glen
glen at pld-linux.org
Thu Dec 22 13:23:32 CET 2011
Author: glen Date: Thu Dec 22 12:23:32 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- tabs
---- Files affected:
packages/nagios-plugin-check_amavis:
check_amavis.pl (1.1 -> 1.2)
---- Diffs:
================================================================
Index: packages/nagios-plugin-check_amavis/check_amavis.pl
diff -u packages/nagios-plugin-check_amavis/check_amavis.pl:1.1 packages/nagios-plugin-check_amavis/check_amavis.pl:1.2
--- packages/nagios-plugin-check_amavis/check_amavis.pl:1.1 Thu Dec 22 12:27:56 2011
+++ packages/nagios-plugin-check_amavis/check_amavis.pl Thu Dec 22 13:23:27 2011
@@ -11,45 +11,48 @@
my $debug = 0;
$result = GetOptions (
- "server|s=s" => \$server,
- "port|p=s" => \$port,
- "from|f=s" => \$from,
- "debug|d" => \$debug,
- "to|t=s" => \$to,
+ "server|s=s" => \$server,
+ "port|p=s" => \$port,
+ "from|f=s" => \$from,
+ "debug|d" => \$debug,
+ "to|t=s" => \$to,
);
if (!$server || !$from) {
- die ("Please specify server, from\n");
+ die ("Please specify server, from\n");
}
-if (!$to) { $to = $from; }
+if (!$to) {
+ $to = $from;
+}
my $EICAR = <<'EOF';
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
EOF
my $top = MIME::Entity->build(
- Type =>"multipart/mixed",
- From => $from,
- To => $to,
- Subject => "EICAR test",
- Data => "This is a test",
+ Type =>"multipart/mixed",
+ From => $from,
+ To => $to,
+ Subject => "EICAR test",
+ Data => "This is a test",
);
$top->attach(
- Data => $EICAR,
- Type => "application/x-msdos-program",
- Encoding => "base64");
+ Data => $EICAR,
+ Type => "application/x-msdos-program",
+ Encoding => "base64",
+);
my $smtp = new Net::SMTP(
- $server,
- Port => $port,
- Debug => $debug,
+ $server,
+ Port => $port,
+ Debug => $debug,
);
if (!$smtp) {
- print "CRITICAL - amavisd-new server unreachable\n";
- exit;
+ print "CRITICAL - amavisd-new server unreachable\n";
+ exit;
}
$smtp->mail($from);
@@ -61,7 +64,7 @@
$smtp->close();
if ($result =~/2.7.1 Ok, discarded/) {
- print "OK - All fine\n"
+ print "OK - All fine\n"
} else {
- print "CRITICAL - amavisd-new returned $result";
+ print "CRITICAL - amavisd-new returned $result";
}
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_amavis/check_amavis.pl?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list