Browse Source

nagios-nrpe: check_amavis: Update regex

I just installed a Debian Stretch with a pack mail and the check_amavis
was not checking the right regex.

Amavis is returning:
2.7.0 Ok, discarded, id=17556-09 - INFECTED: Eicar-Signature
So the regex should be:
-if ($result =~/2.7.0 Ok, discarded, id=[^,]+ - INFECTED: Eicar-Test-Signature/) {
+if ($result =~/2.7.0 Ok, discarded, id=\S+ - INFECTED: Eicar-Signature/) {
tags/10.1.0^2
Benoît S. 4 months ago
committed by Gitea
parent
commit
10385ecf4d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      nagios-nrpe/files/plugins/check_amavis

+ 1
- 1
nagios-nrpe/files/plugins/check_amavis View File

@@ -65,7 +65,7 @@ $smtp->close();

print "$result\n";

if ($result =~/2.7.0 Ok, discarded, id=[^,]+ - INFECTED: Eicar-Test-Signature/) {
if ($result =~/2.7.0 Ok, discarded, id=\S+ - INFECTED: Eicar-Signature/) {
print "OK - All fine\n";
exit 0;
} else {


Loading…
Cancel
Save