ASNMTAP
view release on metacpan or search on metacpan
lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod view on Meta::CPAN
=head1 NAME
ASNMTAP::Asnmtap::Plugins::WebTransact is a Perl module that provides WebTransact functions used by ASNMTAP-based plugins.
=head1 SYNOPSIS
use ASNMTAP::Asnmtap::Plugins::WebTransact;
my @URLS = ();
my $objectWebTransact = ASNMTAP::Asnmtap::Plugins::WebTransact->new ( \$objectPlugins, \@URLS );
@URLS = (
{ Method => 'GET', Url => 'http://www.citap.be/', Qs_var => [], Qs_fixed => [], Exp => "Consulting Internet Technology Alex Peeters", Exp_Fault => ">>>NIHIL<<<", Msg => "Consulting Internet Technology Alex Peeters", Msg_Fault => "Consulting Inter...
);
$objectWebTransact->check ( { } );
undef $objectWebTransact;
=head1 DESCRIPTION
This module implements a check of a Web Transaction.
A Web transaction is a sequence of web pages, often fill out forms, that accomplishes an enquiry or an update.
Common examples are database searches and registration activities.
A Web transaction is specified by
=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 setting from the proxy.
When we specify at the command prompt I<--proxy=username;password@proxyserver:port|domain[,domain]>, the needed and required proxy settings are automatically set.
The command line options I<--timeout>, I<--debug> and I<--debugfile> are also inherited.
B<debug> writes the string form of the request (including query_string) and the response to STDERR.
I<_browseragent> is inherited and specifies the name that your application should use when it presents itself on the network.
I<_SSLversion> is inherited and specifies the SSL version to use.
=item * a list of URLs where each URL is a page in the transaction
=item * corresponding Query Strings containing the CGI names and value pairs to post the page
=item * a means of determining from the content, whether a response is either OK or a failure (WARNING, CRITICAL or UNKNOWN).
=over 4
=item 'KeepAlive' and 'SSL session reuse'
Only SSLv3 and TLSv1 are supporting 'KeepAlive' and 'SSL session reuse'.
To make SSL session reuse possible, 'KeepAlive' need to be on 'On'.
Verify that your browseragent string on the destination servers don't have someting like a 'nokeepalive', 'downgrade-1.0' or 'force-response-1.0'.
Verify that the 'SSL Session Cache' on the destination servers are enabled.
=over 4
=item Apache
=over 4
=item httpd.conf
# KeepAlive: Whether or not to allow persistent connections (more than one request per connection).
KeepAlive On
# The following directives modify normal HTTP response behavior to handle known problems with browser implementations.
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
=item ssl.conf
# Here I am allowing SSLv3 and TLSv1, I am NOT allowing the old SSLv2.
# SSLProtocol all -SSLv2
SSLProtocol -all +TLSv1 +SSLv3
# Notice: Most problems of broken clients are also related to the HTTP keep-alive facility.
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# Inter-Process Session Cache:
# Configure the SSL Session Cache: First the mechanism to use and second the expiring timeout (in seconds).
SSLSessionCache dbm:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
=back
=back
=back
=back
A new ASNMTAP::Asnmtap::Plugins::WebTransact object must be created with the I<new> method. Once
this has been done, the check of the Web Transaction is done with the I<check> method.
=over 4
=item ASNMTAP::Asnmtap::Plugins::WebTransact->new (ref_to_array_of_hash_refs)
A new ASNMTAP::Asnmtap::Plugins::WebTransact object must be created with the I<new> method.
A reference to array of hash references ( \@URLS ) is required.
The field urls contains a reference to a list of (hashes) records representing the Web Transaction.
This is the constructor for a ASNMTAP::Asnmtap::Plugins::WebTransact->new object. C<ref_to_array_of_hash_refs> is a reference to an array of records (anon hash refs) in the format :-
I<Structure of the array of hash references:>
{
Method => HEAD|GET|POST,
Url => 'http://...',
Qs_var => [ cgi_var_name_1 => val_at_run_time, ... ],
Qs_fixed => [ cgi_var_name_1 => val_1, ... ],
Exp => blah,
Exp_Fault => blurb,
Exp_Return => { var_label_1 => EXP_VAR_LABEL_1, ... },
Msg => 'Status error when not all Exp found',
Msg_Fault => 'Status error when Exp_Fault found',
Timeout => 30,
Perfdata_Label => 'Label x'
}
Qs_fixed and Qs_var are used to generate a query string.
Exp, Exp_Fault and Exp_Return are normal Perl patterns without pattern match delimiters. Most often they are strings.
=over 4
=item Method
scalar, possible values: GET, HEAD or POST
=over 4
=item GET
( run in 1.277 second using v1.01-cache-2.11-cpan-df04353d9ac )