Build precise queries to find exactly what you need
Press ESC to close
In general this script works fine. Thanks for the effort of making this for the community.
There is some minor room for improvement though which a wanted to share.
The nagios embedded perl interpreter (can be switched on/off) runs check commands with use strict.
So at line 28 the “$result =” should be “my $result =”, otherwise use strict (of the embedded perl) will fail.
But if the above is changed it clashes with “my $result =” on line 79 . This should be changed to something like “my $smtp_result =”. The $result at line 82 and 86 should be changed accordingly.
The regexp at line 82 only catches if amavis is configures with “$final_virus_destiny = D_DISCARD” or “$final_virus_destiny = D_ACCEPT”. It fails in case of “$final_virus_destiny = D_REJECT”.
An alternative for rule 82 might be:
if ( $smtp_result =~/2.7.[01] Ok, discarded/ or $smtp_result =~/5.7.[01] Reject, id=/ ) {
Or even better perhaps to:
if ( $smtp_result =~ /INFECTED:sEicar-Test-Signature/ ) {
Just a few thoughts for improvement.
Thanks again for the effort.
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!