ASNMTAP
view release on metacpan or search on metacpan
lib/ASNMTAP/Asnmtap/Plugins/Mail.pod view on Meta::CPAN
- Epochtime difference from Date and Time into Fingerprint XML are wrong
- Result into Fingerprint XML are out of date
=item Returns $ERRORS{WARNING} when:
- Result into Fingerprint XML are out of date
=back
=over 4
=item custom
optional, is an reference to your own custom defined function
=over 4
=item $self:
the reference to the current object
=over 4
=item date
date returned from the fingerprint item 'Epochtime'
=item day
day returned from the fingerprint item 'Epochtime'
=item month
month returned from the fingerprint item 'Epochtime'
=item year
year returned from the fingerprint item 'Epochtime'
=item time
time returned from the fingerprint item 'Epochtime'
=item hour
hour returned from the fingerprint item 'Epochtime'
=item min
min returned from the fingerprint item 'Epochtime'
=item sec
sec returned from the fingerprint item 'Epochtime'
=item numberOfMatches
without an custom defined function is this the number of email that matches te fingerprint.
with an custom defined function do you need to increment the value in your custom defined function everytime you say that this mail matches your request.
$self->{defaultArguments}->{numberOfMatches}++;
=item result
the extracted message from the email starting just after the fingerprint
=back
=item $asnmtapInherited:
A required reference to an ASNMTAP::Asnmtap::Plugins or ASNMTAP::Asnmtap::Plugins::Nagios subclass
Through this way of working we inherited the command line option I<--debug>.
=item $email:
=over 4
=item IMAP4
A new Net::IMAP::Simple object is created and all IMAP4 commands are accessed via method calls on this object.
=item POP3
A new Net::POP3 object is created and all POP3 commands are accessed via method calls on this object.
=back
=item $msgnum:
sub actionOnReceivingFingerprintMail {
my ($self, $asnmtapInherited, $email, $msgnum) = @_;
no warnings 'deprecated';
my $returnCode = $ERRORS{OK};
# put here your code regarding the MailBody - - - - - - - - - - - - -
print "\n\n". $self->{defaultArguments}->{result}. "\n\n";
$$asnmtapInherited->pluginValues ( { stateValue => $returnCode, alert => '.' }, $TYPE{APPEND} );
# put here your code for deleting the email from the Mailbox - - - -
# IMAP4
# $email->delete( $msgnum ) unless ( $$asnmtapInherited->getOptionsValue ('debug') or $$asnmtapInherited->getOptionsValue ('onDemand') );
# POP3
# $email->Delete( $msgnum ) unless ( $$asnmtapInherited->getOptionsValue ('debug') or $$asnmtapInherited->getOptionsValue ('onDemand') );
$self->{defaultArguments}->{numberOfMatches}++;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
return ( $returnCode );
}
and now with customArguments:
sub actionOnReceivingFingerprintMail {
( run in 0.871 second using v1.01-cache-2.11-cpan-71847e10f99 )