ASNMTAP

 view release on metacpan or  search on metacpan

lib/ASNMTAP/Asnmtap/Plugins/Mail.pod  view on Meta::CPAN

    _mail             => {
                           from   => 'alex.peeters@citap.be',
                           to     => 'asnmtap@citap.com',
                           status => $APPLICATION .' Status UP',
                           body   => $body
                         }
    );

  $objectPlugins->pluginValues ( { stateValue => $ERRORS{OK}, alert => ':)' }, $TYPE{APPEND} );

  $objectPlugins->exit (7);

=head1 ATTRIBUTES

=over 4

=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 _SMTP

is an HASH, with the same parameters like %Mail::Sendmail::mailcfg{} 

=over 4

=item smtp

this is a reference to a list of smtp servers, so if your main server is down, the module tries the next one. If one of your servers uses a special port, add it to the server name with a colon in front, to override the default port (like in my.specia...

optional, default: localhost

=item port

port used when none is specified in the server name.

optional, scalar value, default: 25

=item from

from address used if you don't supply one in your script. Should not be of type 'user@localhost' since that may not be valid on the recipient's host.

optional, scalar value, default: undefined

=item retries

how many times should the connection to the same SMTP server be retried in case of a failure.

optional, scalar value, default: 3;

=item delay

number of seconds to wait between retries. This delay also happens before trying the next server in the list, if the retries for the current server have been exhausted. For CGI scripts, you want few retries and short delays to return with a results p...

optional, scalar value, default: 1 (second);

=item mime

set this to 0 if you don't want any automatic MIME encoding. You normally don't need this, the module should 'Do the right thing' anyway.

optional, scalar value, default: 0

=item tz

normally, your time zone is set automatically, from the difference between time() and gmtime(). This allows you to override automatic detection in cases where your system is confused.

optional, scalar value, default: undefined (automatic detection at run-time).

=item debug

prints stuff to STDERR. Current maximum is 6, which prints the whole SMTP session, except data exceeding 500 bytes.

optional, scalar value, default: inherited from the parent object command line option -d or --debug

=back

=item _IMAP4

=over 4

=item imap4

IMAP4 host to connect to.

=item port (reserved)

port used when none is specified in the server name.

optional, scalar value, default: 143

=item username

optional, scalar value, default: undef

=item password

optional, scalar value, default: undef

=item timeout

maximum time, in seconds, to wait for a response from the IPAM4 server

optional, scalar value, default: 120 unless inherited from the parent object attribute _timeout

=item debug

debugging information

optional, scalar value, default: inherited from the parent object command line option -d or --debug

=back

=item _POP3

settings used by Net::POP3 - Post Office Protocol 3 Client class (RFC1939)

=over 4

=item pop3

lib/ASNMTAP/Asnmtap/Plugins/Mail.pod  view on Meta::CPAN


=item _mailType

For clients that are sensitive to cookie-based authentication.

optional, mailType can be 0 or 1

  0, TXT formated fingerprint (default)
  1, XML formated fingerprint

=over 4

=item TXT

Each e-mail exists of an TXT fingerprint. This allows us lateron only to pick up the required e-mails with pop3, because we will filter out the emails with a minimum band width the e-mails desired from the mail box. 

When the status and the header plus the first 7 lines of the e-mail agrees to these fingerprint, the e-mail is picked up, processes, and removed from the mail box.

=over 4

=item Fingerprint

=over 4

=item Subject

 SUBJECT / From: Source_email_address To: Application_Monitor_email_address

 SUBJECT: description can be found lateron into this document.

=item Message

 SUBJECT / From: Source_email_address To: Application_Monitor_email_address
 <plugin naam> <plugin description>
 Timestamp <Source email address>: dd-mm-yyyy hh:mm:ss[.hhh]
 Status <naam from the service up/down>

 SUBJECT: description can be found lateron into this document.

=back

=item Example

 ASNMTAP / From: alex.peeters@citap.com To: asnmtap@citap.com 
 <mail-xml-citap-com.pl> <Mail XML plugin template for testing the 'Application Monitoring'>
 Timestamp <alex.peeters@citap.com>: 2006/02/04 11:01:11
 Status <Application Monitoring Status Down>

=back

=item XML

Each e-mail exists of an XML fingerprint. This allows us lateron only to pick up the required e-mails with pop3, because we will filter out the emails with a minimum band width the e-mails desired from the mail box. 

When the status and the header plus the first 5 lines of the e-mail agrees to these fingerprint, the e-mail is picked up, processes, and removed from the mail box.

=over 4

=item DTD for validation XML

 <?xml version="1.0" encoding="UTF-8"?>

 <!ENTITY AUTHOR  "Alex Peeters">
 <!ENTITY EMAIL   "Alex.Peeters@citap.com">
 <!ENTITY PURPOSE "2005/11/15, dtd schema v1.0 for Fingerprint Email by XML">

 <!ELEMENT FingerprintEmail (Schema, Fingerprint)>
 <!ELEMENT Schema (#PCDATA)>
 <!ATTLIST Schema Value CDATA #FIXED "1.0">
 <!ELEMENT Fingerprint (#PCDATA)>
 <!ATTLIST Fingerprint
   From CDATA #REQUIRED
   To CDATA #REQUIRED
   Destination CDATA #REQUIRED
   Plugin CDATA #REQUIRED
   Description CDATA #REQUIRED
   Environment (PROD|TEST|ACC|DEV|SIM|LOCAL) #REQUIRED
   Date CDATA #REQUIRED
   Time CDATA #REQUIRED
   Epochtime CDATA #REQUIRED
   Status CDATA #REQUIRED
 >

=item Example

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE FingerprintEmail SYSTEM "dtd/FingerprintEmail-1.0.dtd"><FingerprintEmail><Schema Value="1.0"/><Fingerprint From="alex.peeters@citap.com" To="asnmtap@citap.com" Destination="ASNMTAP" Plugin="mail-fingerp...

=back

=back

=item _text

required textual descriptions

=over 4

=item SUBJECT

SUBJECT is the textual descriptions for the preffix of the subject

required, scalar value, default: 'uKey=ASNMTAP'

When you have more then one mail plugin, then you should use for the subject an unique key. Normally we use 'uKey=MAIL_?_nnnn' where '?' is the environment and 'nnnn' the number to make the SUBJECT unique.

 - P(roduction) : 'uKey=MAIL_P_0001', 'uKey=MAIL_P_0002' ... 'uKey=MAIL_P_nnnn'
 - S(imulation) : 'uKey=MAIL_S_0001', 'uKey=MAIL_S_0002' ... 'uKey=MAIL_S_nnnn'
 - A(cceptation): 'uKey=MAIL_A_0001', 'uKey=MAIL_A_0002' ... 'uKey=MAIL_A_nnnn'
 - T(est)       : 'uKey=MAIL_T_0001', 'uKey=MAIL_T_0002' ... 'uKey=MAIL_T_nnnn'
 - D(evelopment): 'uKey=MAIL_D_0001', 'uKey=MAIL_D_0002' ... 'uKey=MAIL_D_nnnn'
 - L(ocal)      : 'uKey=MAIL_L_0001', 'uKey=MAIL_L_0002' ... 'uKey=MAIL_L_nnnn'

The reason for this is that the processing from the emails is much faster, because after the verification from the 'To:', 'From:' and 'Subject:' fields from the HEAD of your email you already know if its the required email to process with this plugin...

=item from

is the textual descriptions for from

optional, scalar value, default: 'From:'

=item to

is the textual descriptions for to

optional, scalar value, default: 'To:'

=item subject

is the textual descriptions for the subject

optional, scalar value, default: 'Subject:'

=item status

is the textual descriptions for the status

optional, scalar value, default: 'Status'

=back

=item _mail

required mail parameters

=over 4



( run in 0.737 second using v1.01-cache-2.11-cpan-e1769b4cff6 )