« plugins/templates/check_template-WebTransact-Perfdata.pl
↑ Summary
plugins/templates/check_template-WebTransact-with-client-certificate.pl »
| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||
| 3 | # © Copyright 2003-2011 by Alex Peeters [alex.peeters@citap.be] | ||||||||||
| 4 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||
| 5 | # 2011/mm/dd, v3.002.003, check_template-WebTransact-with-client-authorization.pl | ||||||||||
| 6 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use warnings; # Must be used in test mode only. This reduces a little process speed | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | #use diagnostics; # Must be used in test mode only. This reduces a lot of process speed | ||||||||||
| 11 | |||||||||||
| 12 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } } | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=9.2
Branch: 1 branch
| |||||||||||
| 15 | |||||||||||
| 16 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 17 | |||||||||||
| 18 | 3 | ▶ | use ASNMTAP::Asnmtap::Plugins v3.002.003; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 3 | ▶ | use ASNMTAP::Asnmtap::Plugins qw(:PLUGINS); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 22 | |||||||||||
| 23 | 3 | my $objectPlugins = ASNMTAP::Asnmtap::Plugins->new ( | |||||||||
| 24 | _programName => 'check_template-WebTransact-with-client-authorization.pl', | ||||||||||
| 25 | _programDescription => "WebTransact plugin template for testing the '$APPLICATION' with client authorization", | ||||||||||
| 26 | _programVersion => '3.002.003', | ||||||||||
| 27 | _programGetOptions => ['environment|e:s', 'proxy:s', 'timeout|t:i', 'trendline|T:i'], | ||||||||||
| 28 | _timeout => 30, | ||||||||||
| 29 | _debug => 0); | ||||||||||
| 30 | |||||||||||
| 31 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 32 | |||||||||||
| 33 | 3 | ▶ | use ASNMTAP::Asnmtap::Plugins::WebTransact; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 34 | |||||||||||
| 35 | 1 | my @URLS = (); | |||||||||
| 36 | 1 | my $objectWebTransact = ASNMTAP::Asnmtap::Plugins::WebTransact->new ( \$objectPlugins, \@URLS ); | |||||||||
| 37 | |||||||||||
| 38 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 39 | # Start plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 40 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 41 | |||||||||||
| 42 | 1 | my $returnCode; | |||||||||
| 43 | |||||||||||
| 44 | # methode 1 | ||||||||||
| 45 | 1 | @URLS = ( | |||||||||
| 46 | { Method => 'GET', Url => 'https://USERNAME:PASSWORD@secure.citap.be/authorization/', Qs_var => [], Qs_fixed => [], Exp => "Testing Client Authorization", Exp_Fault => ">>>NIHIL<<<", Msg => "Testing Client Authorization", Msg_Fault => "Testing Client Authorization" }, | ||||||||||
| 47 | ); | ||||||||||
| 48 | |||||||||||
| 49 | 1 | $returnCode = $objectWebTransact->check ( { } ); | |||||||||
| 50 | |||||||||||
| 51 | # methode 2 | ||||||||||
| 52 | 1 | @URLS = ( | |||||||||
| 53 | { Method => 'GET', Url => 'https://secure.citap.com/authorization/', Qs_var => [], Qs_fixed => [], Exp => "Testing Client Authorization", Exp_Fault => ">>>NIHIL<<<", Msg => "Testing Client Authorization", Msg_Fault => "Testing Client Authorization" }, | ||||||||||
| 54 | ); | ||||||||||
| 55 | |||||||||||
| 56 | 1 | $objectWebTransact->ua->credentials ( 'secure.citap.com:443', "ASNMTAP's Authorization Access", 'USERNAME', 'PASSWORD' ); | |||||||||
| 57 | |||||||||||
| 58 | 1 | $returnCode = $objectWebTransact->check ( { } ); | |||||||||
| 59 | |||||||||||
| 60 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 61 | # End plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 62 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 63 | |||||||||||
| 64 | 1 | undef $objectWebTransact; | |||||||||
| 65 | 1 | $objectPlugins->exit (7); | |||||||||
| 66 | |||||||||||
| 67 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||
| 68 | |||||||||||
| 69 | __END__ | ||||||||||