« blib/lib/ASNMTAP/Asnmtap/Applications.pm
↑ Summary
plugins/templates/check_template-mail-xml-fingerprint-xml-monitoring-1.1.pl »
| 1 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # © Copyright 2000-2011 by Alex Peeters [alex.peeters@citap.be] | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # 2011/mm/dd, v3.002.003, package ASNMTAP::Asnmtap::Plugins Object-Oriented Perl | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # ---------------------------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | package ASNMTAP::Asnmtap::Plugins; | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 102 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 102 | ▶ | use warnings; # Must be used in test mode only. This reduces a little process speed | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | #use diagnostics; # Must be used in test mode only. This reduces a lot of process speed | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 102 | ▶ | no warnings 'deprecated'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 102 | ▶ | use Carp qw(carp); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 102 | ▶ | use Time::HiRes qw(gettimeofday tv_interval); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | # include the class files - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 102 | ▶ | use ASNMTAP::Asnmtap qw(:ASNMTAP :COMMANDS :_HIDDEN :PLUGINS); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 102 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 102 | ▶ | use Exporter (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 102 | @ASNMTAP::Asnmtap::Plugins::ISA = qw(Exporter ASNMTAP::Asnmtap); | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 102 | %ASNMTAP::Asnmtap::Plugins::EXPORT_TAGS = (ALL => [ qw($APPLICATION $BUSINESS $DEPARTMENT $COPYRIGHT $SENDEMAILTO | |||||||||||||||||||||||||||||||||||||||||
| 34 | $CAPTUREOUTPUT | ||||||||||||||||||||||||||||||||||||||||||
| 35 | $PREFIXPATH $LOGPATH $PIDPATH $PERL5LIB $MANPATH $LD_LIBRARY_PATH | ||||||||||||||||||||||||||||||||||||||||||
| 36 | $ALARM_OFF %ERRORS %STATE %TYPE | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | $CHATCOMMAND $DIFFCOMMAND $KILLALLCOMMAND $PERLCOMMAND $PPPDCOMMAND $ROUTECOMMAND $RSYNCCOMMAND $SCPCOMMAND $SSHCOMMAND | ||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | &_checkAccObjRef | ||||||||||||||||||||||||||||||||||||||||||
| 41 | &_checkSubArgs0 &_checkSubArgs1 &_checkSubArgs2 | ||||||||||||||||||||||||||||||||||||||||||
| 42 | &_checkReadOnly0 &_checkReadOnly1 &_checkReadOnly2 | ||||||||||||||||||||||||||||||||||||||||||
| 43 | &_dumpValue | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | $PLUGINPATH) ], | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | PLUGINS => [ qw($APPLICATION $BUSINESS $DEPARTMENT $COPYRIGHT $SENDEMAILTO | ||||||||||||||||||||||||||||||||||||||||||
| 48 | $CAPTUREOUTPUT | ||||||||||||||||||||||||||||||||||||||||||
| 49 | $PREFIXPATH $PLUGINPATH $LOGPATH $PIDPATH $PERL5LIB $MANPATH $LD_LIBRARY_PATH | ||||||||||||||||||||||||||||||||||||||||||
| 50 | %ERRORS %STATE %TYPE) ], | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | COMMANDS => [ qw($CHATCOMMAND $DIFFCOMMAND $KILLALLCOMMAND $PERLCOMMAND $PPPDCOMMAND $ROUTECOMMAND $RSYNCCOMMAND $SCPCOMMAND $SSHCOMMAND) ], | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | _HIDDEN => [ qw(&_checkAccObjRef | ||||||||||||||||||||||||||||||||||||||||||
| 55 | &_checkSubArgs0 &_checkSubArgs1 &_checkSubArgs2 | ||||||||||||||||||||||||||||||||||||||||||
| 56 | &_checkReadOnly0 &_checkReadOnly1 &_checkReadOnly2 | ||||||||||||||||||||||||||||||||||||||||||
| 57 | &_dumpValue) ] ); | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 102 | @ASNMTAP::Asnmtap::Plugins::EXPORT_OK = ( @{ $ASNMTAP::Asnmtap::Plugins::EXPORT_TAGS{ALL} } ); | |||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 102 | $ASNMTAP::Asnmtap::Plugins::VERSION = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; | |||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 102 | our $ALARM_OFF = 0; | |||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | # Constructor & initialisation - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 102 | ▶ | sub _init { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=62 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 102 | $_[0]->SUPER::_init($_[1]); | |||||||||||||||||||||||||||||||||||||||||
| 70 | 102 | ▶ | carp ('ASNMTAP::Asnmtap::Plugins: _init') if ( $_[0]->{_debug} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | # --httpdump & --dumphttp tijdelijk voor backwards compatibiliteit !!! | ||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 102 | $_[0]->{_programUsageSuffix} = ' [-S|--status N] [-A|asnmtapEnv [F|T]|[F|T]|[F|T]] [-O|onDemand F|T|N|Y] [-L|--logging <LOGGING>] [-D|--debugfile|--httpdump|--dumphttp <DEBUGFILE>] [-d|--debug F|T|L|M|A|S] '. $_[0]->{_programUsageSuffix}; | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | $_[0]->{_programHelpSuffix} = " | ||||||||||||||||||||||||||||||||||||||||||
| 77 | -S, --status=N | ||||||||||||||||||||||||||||||||||||||||||
| 78 | N(agios) : Nagios custom plugin output (default) | ||||||||||||||||||||||||||||||||||||||||||
| 79 | -A, --asnmtapEnv=[F|T]|[F|T]|[F|T] | ||||||||||||||||||||||||||||||||||||||||||
| 80 | F(alse) : all screendebugging off (default) | ||||||||||||||||||||||||||||||||||||||||||
| 81 | T(true) : all screendebugging on | ||||||||||||||||||||||||||||||||||||||||||
| 82 | | | ||||||||||||||||||||||||||||||||||||||||||
| 83 | F(alse) : all file debugging off (default) | ||||||||||||||||||||||||||||||||||||||||||
| 84 | T(true) : all file debugging on | ||||||||||||||||||||||||||||||||||||||||||
| 85 | | | ||||||||||||||||||||||||||||||||||||||||||
| 86 | F(alse) : nok file debugging off (default) | ||||||||||||||||||||||||||||||||||||||||||
| 87 | T(true) : nok file debugging on | ||||||||||||||||||||||||||||||||||||||||||
| 88 | -O, --onDemand=F|T|N|Y | ||||||||||||||||||||||||||||||||||||||||||
| 89 | F(alse)/N(o) : normal plugin execution (default) | ||||||||||||||||||||||||||||||||||||||||||
| 90 | T(true)/Y(es) : plugin launched on demand | ||||||||||||||||||||||||||||||||||||||||||
| 91 | -L, --logging=LOGGING | ||||||||||||||||||||||||||||||||||||||||||
| 92 | write logging to file LOGGING | ||||||||||||||||||||||||||||||||||||||||||
| 93 | -D, --debugfile, --httpdump, --dumphttp=DEBUGFILE | ||||||||||||||||||||||||||||||||||||||||||
| 94 | write debug to file DEBUGFILE | ||||||||||||||||||||||||||||||||||||||||||
| 95 | -d, --debug=F|T|L|M|A|S | ||||||||||||||||||||||||||||||||||||||||||
| 96 | F(alse) : screendebugging off (default) | ||||||||||||||||||||||||||||||||||||||||||
| 97 | T(true) : normal screendebugging on | ||||||||||||||||||||||||||||||||||||||||||
| 98 | L(ong) : long screendebugging on | ||||||||||||||||||||||||||||||||||||||||||
| 99 | M(oderator) : long screendebugging on for Moderators | ||||||||||||||||||||||||||||||||||||||||||
| 100 | A(dmin) : long screendebugging on for Admins | ||||||||||||||||||||||||||||||||||||||||||
| 101 | S(erver Admin): long screendebugging on for Server Admins | ||||||||||||||||||||||||||||||||||||||||||
| 102 | 102 | " . $_[0]->{_programHelpSuffix}; | |||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 102 | push ( @{ $_[0]->{_programGetOptions} }, 'status|S:s', 'asnmtapEnv|A:s', 'onDemand|O:s', 'logging|L:s', 'debugfile|D|dumphttp|httpdump:s', 'debug|d:s' ); | |||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 102 | my ($_programUsageSuffix, $_programHelpSuffix); | |||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 102 | foreach ( @{ $_[0]->{_programGetOptions} } ) { | |||||||||||||||||||||||||||||||||||||||||
| 109 | 1729 | for ($_) { | |||||||||||||||||||||||||||||||||||||||||
| 110 | 1729 | ▶ | /^trendline\|T([:=])i$/ && do { $_[0]->{_getOptionsType}->{trendline} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-T|--trendline <TRENDLINE>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-T, --trendline <TRENDLINE>\n trendline threshold (seconds) from which a TRENDLINE status will result for the plugin response time\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 1656 | ▶ | /^timeout\|t([:=])i$/ && do { $_[0]->{_getOptionsType}->{timeout} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-t|--timeout <TIMEOUT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-t, --timeout=<TIMEOUT>\n timeout threshold (seconds) from which a UNKNOWN status will result for the plugin execution time\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 1600 | ▶ | /^environment\|e([:=])s$/ && do { $_[0]->{_getOptionsType}->{environment} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-e|--environment <ENVIRONMENT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-e, --environment=<ENVIRONMENT>\n P(roduction)\n S(imulation)\n A(cceptation)\n T(est)\n D(evelopment)\n L(ocal)\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | 1515 | ▶ | /^proxy([:=])s$/ && do { $_[0]->{_getOptionsType}->{proxy} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'--proxy <username:password@proxy:port&domain[,domain]>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "--proxy=<username:password\@proxy:port&domain[,domain]>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 1481 | ▶ | /^host\|H([:=])s$/ && do { $_[0]->{_getOptionsType}->{host} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-H|--host <HOST>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-H, --host=<HOST>\n hostname or ip address\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 1464 | ▶ | /^url\|U([:=])s$/ && do { $_[0]->{_getOptionsType}->{url} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-U|--url <URL>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-U, --url=<URL>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 1453 | ▶ | /^port\|P([:=])i$/ && do { $_[0]->{_getOptionsType}->{port} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-P|--port <PORT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-P, --port=<PORT>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 1449 | ▶ | /^community\|C([:=])s$/ && do { $_[0]->{_getOptionsType}->{community} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-C|--community <SNMP COMMUNITY>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-C, --community=<SNMP COMMUNITY>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 1447 | ▶ | /^username\|u\|loginname([:=])s$/ && do { $_[0]->{_getOptionsType}->{username} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-u|--username|--loginname <USERNAME>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-u, --username/--loginname=<USERNAME>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 1420 | ▶ | /^password\|p\|passwd([:=])s$/ && do { $_[0]->{_getOptionsType}->{password} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-p|--password|--passwd <PASSWORD>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-p, --password/--passwd=<PASSWORD>\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 1393 | ▶ | /^filename\|F([:=])s$/ && do { $_[0]->{_getOptionsType}->{filename} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-F|--filename <FILENAME>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-F, --filename=<FILENAME>\n XML filename with the ASNMTAP/Nagios compatible test results\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 1369 | ▶ | /^interval\|i([:=])i$/ && do { $_[0]->{_getOptionsType}->{interval} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-i|--interval <SECONDS>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-i, --interval=<SECONDS>\n interval threshold (seconds) from which a CRITICAL (2x) or WARNING (1x) status will result when XML fingerprint out of time\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | /^loglevel\|l([:=])s$/ && do { $_[0]->{_getOptionsType}->{loglevel} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-l|--loglevel <LOGLEVEL>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-l, --loglevel=<LOGLEVEL>\n loglevel, one of (order of decrescent verbosity): debug, verbose, notice, info, warning, err, crit, alert, emerg\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | /^year\|Y([:=])i$/ && do { $_[0]->{_getOptionsType}->{year} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-Y|--year <YEAR>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-Y, --year=<YEAR>\n year, format: [19|20|21]yy\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | /^quarter\|Q([:=])i$/ && do { $_[0]->{_getOptionsType}->{quarter} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-Q|--quarter <QUARTER>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-Q, --quarter=<QUARTER>\n quarter, where value 0..4\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | /^month\|M([:=])i$/ && do { $_[0]->{_getOptionsType}->{month} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-M|--month <MONTH>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-M, --month=<MONTH>\n month, where value 1..12\n"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 1328 | ▶ | /^warning\|w([:=])s$/ && do { $_[0]->{_getOptionsType}->{warning} = $1; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 1322 | ▶ | /^critical\|c([:=])s$/ && do { $_[0]->{_getOptionsType}->{critical} = $1; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 102 | ▶ | $_[0]->{_programUsageSuffix} = $_programUsageSuffix .' '. $_[0]->{_programUsageSuffix} if (defined $_programUsageSuffix); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||
| 134 | 102 | ▶ | $_[0]->{_programHelpSuffix} = "\n". $_programHelpSuffix . $_[0]->{_programHelpSuffix} if (defined $_programHelpSuffix); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | 102 | $_[0]->[ $_[0]->[0]{_exit_} = @{$_[0]} ] = 0; | |||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | 102 | ▶ | $_[0]->[ $_[0]->[0]{_plugins} = @{$_[0]} ] = (defined $_[1]->{_plugins}) ? $_[1]->{_plugins} : 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 102 | ▶ | $_[0]->[ $_[0]->[0]{_timeout} = @{$_[0]} ] = (defined $_[1]->{_timeout}) ? $_[1]->{_timeout} : 10; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 102 | ▶ | $_[0]->[ $_[0]->[0]{_browseragent} = @{$_[0]} ] = (defined $_[1]->{_browseragent}) ? $_[1]->{_browseragent} : 'Mozilla/5.0 (compatible; ASNMTAP; U; ASNMTAP 3.002.003 postfix; nl-BE; rv:3.002.003) Gecko/yyyymmdd libwww-perl/5.813'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||
| 144 | 102 | ▶ | $_[0]->[ $_[0]->[0]{_SSLversion} = @{$_[0]} ] = (defined $_[1]->{_SSLversion} and $_[1]->{_SSLversion} =~ /^(?:2|3|23)$/) ? $_[1]->{_SSLversion} : 3; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[1]{"_SSLversion"} and $_[1]{"_SSLversion"} =~ /^(?:2|3|23)$/
MC/DC50%1/2
defined $_[1]{"_SSLversion"} and $_[1]{"_SSLversion"} =~ /^(?:2|3|23)$/
defined $_[1]{"_SSLversion"}
$_[1]{"_SSLversion"} =~ /^(?:2|3|23)$/
Truth table66%2/3
A and B
A= defined $_[1]{"_SSLversion"}B= $_[1]{"_SSLversion"} =~ /^(?:2|3|23)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 102 | ▶ | $_[0]->[ $_[0]->[0]{_clientCertificate} = @{$_[0]} ] = $_[1]->{_clientCertificate} if (defined $_[1]->{_clientCertificate}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | 126 | ▶ | sub _getOptions { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_getOptions: called CC=112 SCAR=72.4
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 126 | $_[0]->SUPER::_getOptions(); | |||||||||||||||||||||||||||||||||||||||||
| 153 | 78 | ▶ | carp ('ASNMTAP::Asnmtap::Plugins: _getOptions') if ( $_[0]->{_debug} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | # Default _pluginValues - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | 78 | $_[0]->[ $_[0]->[0]{_pluginValues} = @{$_[0]} ] = {}; | |||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | 78 | $_[0]->{_pluginValues}->{stateValue} = $ERRORS{DEPENDENT}; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 78 | $_[0]->{_pluginValues}->{stateError} = $STATE{$_[0]->{_pluginValues}->{stateValue}}; | |||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||
| 162 | 78 | $_[0]->{_pluginValues}->{message} = $_[0]->{_programDescription}; | |||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | 78 | $_[0]->{_pluginValues}->{alert} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 165 | 78 | $_[0]->{_pluginValues}->{error} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 78 | $_[0]->{_pluginValues}->{result} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | 78 | $_[0]->{_pluginValues}->{performanceData} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 78 | my ($startTimeSeconds, $startTimeMicroseconds) = gettimeofday(); | |||||||||||||||||||||||||||||||||||||||||
| 171 | 78 | $_[0]->{_pluginValues}->{startTime} = $startTimeSeconds .'.'. $startTimeMicroseconds; | |||||||||||||||||||||||||||||||||||||||||
| 172 | 78 | $_[0]->{_pluginValues}->{endTime} = $_[0]->{_pluginValues}->{startTime}; | |||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | # Options that are unknown, ambiguous or supplied with an invalid option value are passed through in @ARGV | ||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||
| 176 | 78 | ▶ | if ( @ARGV ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | $_[0]->{_pluginValues}->{error} = "Unknown option(s) @ARGV"; | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $_[0]->{_exit_} = 2; | |||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $_[0]->exit(0); | |||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | # Default command line options - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | 78 | ▶ | my $status = (exists $_[0]->{_getOptionsArgv}->{status}) ? $_[0]->{_getOptionsArgv}->{status} : 'N'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 78 | ▶ | $_[0]->printUsage ('Invalid status option: '. $status) unless ($status =~ /^[N]$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | 78 | ▶ | if (exists $_[0]->{_getOptionsArgv}->{asnmtapEnv}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my $asnmtapEnv = $_[0]->{_getOptionsArgv}->{asnmtapEnv}; | |||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my ($boolean_screenDebug, $boolean_debug_all, $boolean_debug_NOK) = split (/\|/, $asnmtapEnv); | |||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | $_[0]->printUsage ('Wrong ASNMTAP environment options: '. $asnmtapEnv) unless (defined $boolean_screenDebug and defined $boolean_debug_all and defined $boolean_debug_NOK); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $boolean_screenDebug and defined $boolean_debug_all and defined $boolean_debug_NOK
defined $boolean_screenDebug and defined $boolean_debug_all
MC/DC0%0/3
defined $boolean_screenDebug and defined $boolean_debug_all and defined $boolean_debug_NOK
defined $boolean_screenDebug
defined $boolean_debug_all
defined $boolean_debug_NOK
Truth table0%0/4
A and B and C
A= defined $boolean_screenDebugB= defined $boolean_debug_allC= defined $boolean_debug_NOK
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | $_[0]->printUsage ('Invalid ASNMTAP environment options: '. $asnmtapEnv) unless ($boolean_screenDebug =~ /^[TF]$/ and $boolean_debug_all =~ /^[TF]$/ and $boolean_debug_NOK =~ /^[TF]$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$boolean_screenDebug =~ /^[TF]$/ and $boolean_debug_all =~ /^[TF]$/ and $boolean_debug_NOK =~ /^[TF]$/
$boolean_screenDebug =~ /^[TF]$/ and $boolean_debug_all =~ /^[TF]$/
MC/DC0%0/3
$boolean_screenDebug =~ /^[TF]$/ and $boolean_debug_all =~ /^[TF]$/ and $boolean_debug_NOK =~ /^[TF]$/
$boolean_screenDebug =~ /^[TF]$/
$boolean_debug_all =~ /^[TF]$/
$boolean_debug_NOK =~ /^[TF]$/
Truth table0%0/4
A and B and C
A= $boolean_screenDebug =~ /^[TF]$/B= $boolean_debug_all =~ /^[TF]$/C= $boolean_debug_NOK =~ /^[TF]$/
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | $_[0]->{_getOptionsValues}->{boolean_screenDebug} = ($boolean_screenDebug eq 'T') ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | $_[0]->{_getOptionsValues}->{boolean_debug_all} = ($boolean_debug_all eq 'T') ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | $_[0]->{_getOptionsValues}->{boolean_debug_NOK} = ($boolean_debug_NOK eq 'T') ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 198 | 78 | $_[0]->{_getOptionsValues}->{boolean_screenDebug} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 199 | 78 | $_[0]->{_getOptionsValues}->{boolean_debug_all} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 200 | 78 | $_[0]->{_getOptionsValues}->{boolean_debug_NOK} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||
| 203 | 78 | ▶ | my $onDemand = (exists $_[0]->{_getOptionsArgv}->{onDemand}) ? $_[0]->{_getOptionsArgv}->{onDemand} : 'F'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 78 | ▶ | $_[0]->printUsage ('Invalid on demand option: '. $onDemand) unless ($onDemand =~ /^[FTNY]$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 205 | 78 | ▶ | $_[0]->{_getOptionsValues}->{onDemand} = ($onDemand =~ /^[TY]$/) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||
| 207 | # exists $_[0]->{_getOptionsArgv}->{logging} | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 78 | ▶ | if ( defined $_[0]->{_getOptionsArgv}->{debugfile} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | unlink $_[0]->{_getOptionsArgv}->{debugfile} if ( -s $_[0]->{_getOptionsArgv}->{debugfile} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||
| 213 | 78 | ▶ | my $debug = (exists $_[0]->{_getOptionsArgv}->{debug}) ? $_[0]->{_getOptionsArgv}->{debug} : 'F'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 214 | 78 | ▶ | $_[0]->printUsage ('Invalid debug option: '. $debug) unless ($debug =~ /^[FTLMAS]$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | 78 | ▶ | $_[0]->{_getOptionsValues}->{debug} = ($debug eq 'T') ? 1 : (($debug eq 'L') ? 2 : (($debug eq 'M') ? 3 : (($debug eq 'A') ? 4 : ((($debug eq 'S') ? 5 : 0))))); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | # Reserved command line options - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | 78 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{timeout} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | my $timeout = $1 if ( $_[0]->{_getOptionsArgv}->{timeout} =~ m/^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | $_[0]->printUsage ('Invalid timeout: '. $_[0]->{_getOptionsArgv}->{timeout}) unless (defined $timeout); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{timeout} and $_[0]->{_getOptionsType}->{timeout} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"timeout"} and $_[0]{"_getOptionsType"}{"timeout"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"timeout"} and $_[0]{"_getOptionsType"}{"timeout"} eq "="
exists $_[0]{"_getOptionsType"}{"timeout"}
$_[0]{"_getOptionsType"}{"timeout"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"timeout"}B= $_[0]{"_getOptionsType"}{"timeout"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | $_[0]->printUsage ('Missing command line argument timeout'); | |||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||
| 226 | 78 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{trendline} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | my $trendline = $1 if ( $_[0]->{_getOptionsArgv}->{trendline} =~ m/^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | $_[0]->printUsage ('Invalid trendline: '. $_[0]->{_getOptionsArgv}->{trendline}) unless (defined $trendline); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 229 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{trendline} and $_[0]->{_getOptionsType}->{trendline} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"trendline"} and $_[0]{"_getOptionsType"}{"trendline"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"trendline"} and $_[0]{"_getOptionsType"}{"trendline"} eq "="
exists $_[0]{"_getOptionsType"}{"trendline"}
$_[0]{"_getOptionsType"}{"trendline"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"trendline"}B= $_[0]{"_getOptionsType"}{"trendline"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | $_[0]->printUsage ('Missing command line argument trendline'); | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 78 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{environment} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | 22 | ▶ | $_[0]->printUsage ('Invalid environment option: '. $_[0]->{_getOptionsArgv}->{environment}) unless ($_[0]->{_getOptionsArgv}->{environment} =~ /^[PSATDL]$/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||
| 236 | 22 | for ($_[0]->{_getOptionsArgv}->{environment}) { | |||||||||||||||||||||||||||||||||||||||||
| 237 | 22 | ▶ | /P/ && do { $_[0]->{_getOptionsValues}->{environment} = "Production"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | /S/ && do { $_[0]->{_getOptionsValues}->{environment} = "Simulation"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | /A/ && do { $_[0]->{_getOptionsValues}->{environment} = "Acceptation"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | /T/ && do { $_[0]->{_getOptionsValues}->{environment} = "Test"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | /D/ && do { $_[0]->{_getOptionsValues}->{environment} = "Development"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 242 | 6 | ▶ | /L/ && do { $_[0]->{_getOptionsValues}->{environment} = "Local"; last; }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $_[0]->{_getOptionsValues}->{environment} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||
| 245 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{environment} and $_[0]->{_getOptionsType}->{environment} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
exists $_[0]{"_getOptionsType"}{"environment"} and $_[0]{"_getOptionsType"}{"environment"} eq "="
MC/DC100%2/2
exists $_[0]{"_getOptionsType"}{"environment"} and $_[0]{"_getOptionsType"}{"environment"} eq "="
exists $_[0]{"_getOptionsType"}{"environment"}
$_[0]{"_getOptionsType"}{"environment"} eq "="
Truth table100%3/3
A and B
A= exists $_[0]{"_getOptionsType"}{"environment"}B= $_[0]{"_getOptionsType"}{"environment"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 246 | 21 | $_[0]->printUsage ('Missing command line argument environment'); | |||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||
| 249 | 57 | $_[0]->_init_proxy_and_client_certificate (); | |||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 57 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{host} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | 6 | ▶ | my $host = $1 if ( $_[0]->{_getOptionsArgv}->{host} =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z][-a-zA-Z0-9]+(\.[a-zA-Z][-a-zA-Z0-9]+)*)$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 6 | ▶ | $_[0]->printUsage ('Invalid hostname or ip address: '. $_[0]->{_getOptionsArgv}->{host}) unless (defined $host); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{host} and $_[0]->{_getOptionsType}->{host} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
exists $_[0]{"_getOptionsType"}{"host"} and $_[0]{"_getOptionsType"}{"host"} eq "="
MC/DC100%2/2
exists $_[0]{"_getOptionsType"}{"host"} and $_[0]{"_getOptionsType"}{"host"} eq "="
exists $_[0]{"_getOptionsType"}{"host"}
$_[0]{"_getOptionsType"}{"host"} eq "="
Truth table100%3/3
A and B
A= exists $_[0]{"_getOptionsType"}{"host"}B= $_[0]{"_getOptionsType"}{"host"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | 4 | $_[0]->printUsage ('Missing command line argument host'); | |||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||
| 258 | 53 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{url} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | # ... TODO ... | ||||||||||||||||||||||||||||||||||||||||||
| 260 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{url} and $_[0]->{_getOptionsType}->{url} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"url"} and $_[0]{"_getOptionsType"}{"url"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"url"} and $_[0]{"_getOptionsType"}{"url"} eq "="
exists $_[0]{"_getOptionsType"}{"url"}
$_[0]{"_getOptionsType"}{"url"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"url"}B= $_[0]{"_getOptionsType"}{"url"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | $_[0]->printUsage ('Missing command line argument url'); | |||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||
| 264 | 53 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{port} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | my $port = $1 if ( $_[0]->{_getOptionsArgv}->{port} =~ m/^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | $_[0]->printUsage ('Invalid port: '. $_[0]->{_getOptionsArgv}->{port}) unless (defined $port); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 267 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{port} and $_[0]->{_getOptionsType}->{port} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"port"} and $_[0]{"_getOptionsType"}{"port"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"port"} and $_[0]{"_getOptionsType"}{"port"} eq "="
exists $_[0]{"_getOptionsType"}{"port"}
$_[0]{"_getOptionsType"}{"port"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"port"}B= $_[0]{"_getOptionsType"}{"port"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | $_[0]->printUsage ('Missing command line argument port'); | |||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||
| 271 | 53 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{community} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | # ... TODO ... | ||||||||||||||||||||||||||||||||||||||||||
| 273 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{community} and $_[0]->{_getOptionsType}->{community} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"community"} and $_[0]{"_getOptionsType"}{"community"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"community"} and $_[0]{"_getOptionsType"}{"community"} eq "="
exists $_[0]{"_getOptionsType"}{"community"}
$_[0]{"_getOptionsType"}{"community"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"community"}B= $_[0]{"_getOptionsType"}{"community"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | $_[0]->printUsage ('Missing command line argument community'); | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||
| 277 | 53 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{username} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 278 | # ... TODO ... | ||||||||||||||||||||||||||||||||||||||||||
| 279 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{username} and $_[0]->{_getOptionsType}->{username} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
exists $_[0]{"_getOptionsType"}{"username"} and $_[0]{"_getOptionsType"}{"username"} eq "="
MC/DC100%2/2
exists $_[0]{"_getOptionsType"}{"username"} and $_[0]{"_getOptionsType"}{"username"} eq "="
exists $_[0]{"_getOptionsType"}{"username"}
$_[0]{"_getOptionsType"}{"username"} eq "="
Truth table100%3/3
A and B
A= exists $_[0]{"_getOptionsType"}{"username"}B= $_[0]{"_getOptionsType"}{"username"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 280 | 1 | $_[0]->printUsage ('Missing command line argument username'); | |||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||
| 283 | 52 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{password} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 284 | # ... TODO ... | ||||||||||||||||||||||||||||||||||||||||||
| 285 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{password} and $_[0]->{_getOptionsType}->{password} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
exists $_[0]{"_getOptionsType"}{"password"} and $_[0]{"_getOptionsType"}{"password"} eq "="
MC/DC100%2/2
exists $_[0]{"_getOptionsType"}{"password"} and $_[0]{"_getOptionsType"}{"password"} eq "="
exists $_[0]{"_getOptionsType"}{"password"}
$_[0]{"_getOptionsType"}{"password"} eq "="
Truth table100%3/3
A and B
A= exists $_[0]{"_getOptionsType"}{"password"}B= $_[0]{"_getOptionsType"}{"password"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 286 | 1 | $_[0]->printUsage ('Missing command line argument password'); | |||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||
| 289 | 51 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{filename} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | # ... TODO ... | ||||||||||||||||||||||||||||||||||||||||||
| 291 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{filename} and $_[0]->{_getOptionsType}->{filename} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"filename"} and $_[0]{"_getOptionsType"}{"filename"} eq "="
MC/DC50%1/2
exists $_[0]{"_getOptionsType"}{"filename"} and $_[0]{"_getOptionsType"}{"filename"} eq "="
exists $_[0]{"_getOptionsType"}{"filename"}
$_[0]{"_getOptionsType"}{"filename"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"filename"}B= $_[0]{"_getOptionsType"}{"filename"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 292 | 2 | $_[0]->printUsage ('Missing command line argument filename'); | |||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||
| 295 | 49 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{interval} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 14 | ▶ | my $interval = $1 if ( $_[0]->{_getOptionsArgv}->{interval} =~ m/^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 14 | ▶ | $_[0]->printUsage ('Invalid interval: '. $_[0]->{_getOptionsArgv}->{interval}) unless (defined $interval); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 298 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{interval} and $_[0]->{_getOptionsType}->{interval} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"interval"} and $_[0]{"_getOptionsType"}{"interval"} eq "="
MC/DC50%1/2
exists $_[0]{"_getOptionsType"}{"interval"} and $_[0]{"_getOptionsType"}{"interval"} eq "="
exists $_[0]{"_getOptionsType"}{"interval"}
$_[0]{"_getOptionsType"}{"interval"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"interval"}B= $_[0]{"_getOptionsType"}{"interval"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | 2 | $_[0]->printUsage ('Missing command line argument interval'); | |||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||
| 302 | 47 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{loglevel} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | ▶ | my $loglevel = $1 if ( $_[0]->{_getOptionsArgv}->{loglevel} =~ m/^(debug|verbose|notice|info|warning|err|crit|alert|emerg)$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | $_[0]->printUsage ('Invalid loglevel: '. $_[0]->{_getOptionsArgv}->{loglevel}) unless (defined $loglevel); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 305 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{loglevel} and $_[0]->{_getOptionsType}->{loglevel} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
exists $_[0]{"_getOptionsType"}{"loglevel"} and $_[0]{"_getOptionsType"}{"loglevel"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"loglevel"} and $_[0]{"_getOptionsType"}{"loglevel"} eq "="
exists $_[0]{"_getOptionsType"}{"loglevel"}
$_[0]{"_getOptionsType"}{"loglevel"} eq "="
Truth table33%1/3
A and B
A= exists $_[0]{"_getOptionsType"}{"loglevel"}B= $_[0]{"_getOptionsType"}{"loglevel"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | $_[0]->printUsage ('Missing command line argument loglevel'); | |||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||
| 309 | 47 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{year} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | my $year = $1 if ( $_[0]->{_getOptionsArgv}->{year} =~ m/^((?:19|20|21)\d{2,2})$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | $_[0]->printUsage ('Invalid year: '. $_[0]->{_getOptionsArgv}->{year}) unless (defined $year); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 312 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{year} and $_[0]->{_getOptionsType}->{year} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
exists $_[0]{"_getOptionsType"}{"year"} and $_[0]{"_getOptionsType"}{"year"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"year"} and $_[0]{"_getOptionsType"}{"year"} eq "="
exists $_[0]{"_getOptionsType"}{"year"}
$_[0]{"_getOptionsType"}{"year"} eq "="
Truth table33%1/3
A and B
A= exists $_[0]{"_getOptionsType"}{"year"}B= $_[0]{"_getOptionsType"}{"year"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $_[0]->printUsage ('Missing command line argument year'); | |||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||
| 316 | 47 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{quarter} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | my $quarter = $1 if ( $_[0]->{_getOptionsArgv}->{quarter} =~ m/^([1-4])$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | $_[0]->printUsage ('Invalid quarter: '. $_[0]->{_getOptionsArgv}->{quarter}) unless (defined $quarter); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 319 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{quarter} and $_[0]->{_getOptionsType}->{quarter} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
exists $_[0]{"_getOptionsType"}{"quarter"} and $_[0]{"_getOptionsType"}{"quarter"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"quarter"} and $_[0]{"_getOptionsType"}{"quarter"} eq "="
exists $_[0]{"_getOptionsType"}{"quarter"}
$_[0]{"_getOptionsType"}{"quarter"} eq "="
Truth table33%1/3
A and B
A= exists $_[0]{"_getOptionsType"}{"quarter"}B= $_[0]{"_getOptionsType"}{"quarter"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | $_[0]->printUsage ('Missing command line argument quarter'); | |||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||
| 323 | 47 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{month} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | my $month = $1 if ( $_[0]->{_getOptionsArgv}->{month} =~ m/^([1-9]|1[0-2])$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | $_[0]->printUsage ('Invalid month: '. $_[0]->{_getOptionsArgv}->{month}) unless (defined $month); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 326 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{month} and $_[0]->{_getOptionsType}->{month} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
exists $_[0]{"_getOptionsType"}{"month"} and $_[0]{"_getOptionsType"}{"month"} eq "="
MC/DC0%0/2
exists $_[0]{"_getOptionsType"}{"month"} and $_[0]{"_getOptionsType"}{"month"} eq "="
exists $_[0]{"_getOptionsType"}{"month"}
$_[0]{"_getOptionsType"}{"month"} eq "="
Truth table33%1/3
A and B
A= exists $_[0]{"_getOptionsType"}{"month"}B= $_[0]{"_getOptionsType"}{"month"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | $_[0]->printUsage ('Missing command line argument month'); | |||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | # Reserved command line options - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||
| 332 | 47 | ▶ | if (exists $_[0]->{_getOptionsArgv}->{warning}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 333 | 2 | ▶ | my $warning = $1 if ( $_[0]->{_getOptionsArgv}->{warning} =~ /^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 334 | 2 | ▶ | $_[0]->printUsage ('Invalid warning threshold ranges '. $_[0]->{_getOptionsArgv}->{warning}) unless (defined $warning); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 335 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{warning} and $_[0]->{_getOptionsType}->{warning} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"warning"} and $_[0]{"_getOptionsType"}{"warning"} eq "="
MC/DC50%1/2
exists $_[0]{"_getOptionsType"}{"warning"} and $_[0]{"_getOptionsType"}{"warning"} eq "="
exists $_[0]{"_getOptionsType"}{"warning"}
$_[0]{"_getOptionsType"}{"warning"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"warning"}B= $_[0]{"_getOptionsType"}{"warning"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | 1 | $_[0]->printUsage ('Missing command line argument warning'); | |||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||||||||||||||||
| 339 | 46 | ▶ | if (exists $_[0]->{_getOptionsArgv}->{critical}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 340 | 1 | ▶ | my $critical = $1 if ($_[0]->{_getOptionsArgv}->{critical} =~ /^([1-9]?(?:\d*))$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 341 | 1 | ▶ | $_[0]->printUsage ('Invalid critical threshold range: '. $_[0]->{_getOptionsArgv}->{critical}) unless (defined $critical); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 342 | ▶ | } elsif ( exists $_[0]->{_getOptionsType}->{critical} and $_[0]->{_getOptionsType}->{critical} eq '=' ) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $_[0]{"_getOptionsType"}{"critical"} and $_[0]{"_getOptionsType"}{"critical"} eq "="
MC/DC50%1/2
exists $_[0]{"_getOptionsType"}{"critical"} and $_[0]{"_getOptionsType"}{"critical"} eq "="
exists $_[0]{"_getOptionsType"}{"critical"}
$_[0]{"_getOptionsType"}{"critical"} eq "="
Truth table66%2/3
A and B
A= exists $_[0]{"_getOptionsType"}{"critical"}B= $_[0]{"_getOptionsType"}{"critical"} eq "="
| |||||||||||||||||||||||||||||||||||||||||||
| 343 | 1 | $_[0]->printUsage ('Missing command line argument critical'); | |||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||
| 346 | # Default _pluginValues - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||
| 348 | 45 | ▶ | $_[0]->{_pluginValues}->{message} .= ' ('. $_[0]->{_getOptionsValues}->{environment} .')' if ( defined $_[0]->{_getOptionsValues}->{environment} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||
| 350 | 45 | ($startTimeSeconds, $startTimeMicroseconds) = gettimeofday(); | |||||||||||||||||||||||||||||||||||||||||
| 351 | 45 | $_[0]->{_pluginValues}->{startTime} = $startTimeSeconds .'.'. $startTimeMicroseconds; | |||||||||||||||||||||||||||||||||||||||||
| 352 | 45 | $_[0]->{_pluginValues}->{endTime} = $_[0]->{_pluginValues}->{startTime}; | |||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | # Timing Out Slow Plugins - part 1/2 - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||
| 356 | 45 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{timeout} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | $_[0]->{_pluginValues}->{_alarm_} = alarm (0); | |||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | ▶ | if ( $_[0]->{_pluginValues}->{_alarm_} && $_[0]->{_getOptionsArgv}->{timeout} > $_[0]->{_pluginValues}->{_alarm_} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0]{"_pluginValues"}{"_alarm_"} and $_[0]{"_getOptionsArgv"}{"timeout"} > $_[0]{"_pluginValues"}{"_alarm_"}
MC/DC0%0/2
$_[0]{"_pluginValues"}{"_alarm_"} and $_[0]{"_getOptionsArgv"}{"timeout"} > $_[0]{"_pluginValues"}{"_alarm_"}
$_[0]{"_pluginValues"}{"_alarm_"}
$_[0]{"_getOptionsArgv"}{"timeout"} > $_[0]{"_pluginValues"}{"_alarm_"}
Truth table0%0/3
A and B
A= $_[0]{"_pluginValues"}{"_alarm_"}B= $_[0]{"_getOptionsArgv"}{"timeout"} > $_[0]{"_pluginValues"}{"_alarm_"}
| |||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | $_[0]->{_getOptionsArgv}->{timeout} = $_[0]->{_pluginValues}->{_alarm_}; | |||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | $_[0]->{_pluginValues}->{_handler_} = $SIG{ALRM}; | |||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | $SIG{ALRM} = sub { $ALARM_OFF = 1; die "ASNMTAP::Asnmtap::Plugins::ALARM_OFF = 1\n" }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | alarm ( $_[0]->{_getOptionsArgv}->{timeout} ); | |||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||||||||||||||||
| 369 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | 57 | ▶ | sub _init_proxy_and_client_certificate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init_proxy_and_client_certificate: called CC=23 SCAR=34.8
| |||||||||||||||||||||||||||||||||||||||||||
| 372 | 57 | ▶ | my $proxy = ( exists $ENV{ASNMTAP_PROXY} ? $ENV{ASNMTAP_PROXY} : ( exists $_[0]->{_getOptionsArgv}->{proxy} and defined $_[0]->{_getOptionsArgv}->{proxy} ? $_[0]->{_getOptionsArgv}->{proxy} : undef ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
exists $_[0]{"_getOptionsArgv"}{"proxy"} and defined $_[0]{"_getOptionsArgv"}{"proxy"} ? $_[0]{"_getOptionsArgv"}{"proxy"} : undef
MC/DC0%0/2
exists $_[0]{"_getOptionsArgv"}{"proxy"} and defined $_[0]{"_getOptionsArgv"}{"proxy"} ? $_[0]{"_getOptionsArgv"}{"proxy"} : undef
exists $_[0]{"_getOptionsArgv"}{"proxy"}
defined $_[0]{"_getOptionsArgv"}{"proxy"} ? $_[0]{"_getOptionsArgv"}{"proxy"} : undef
Truth table33%1/3
A and B
A= exists $_[0]{"_getOptionsArgv"}{"proxy"}B= defined $_[0]{"_getOptionsArgv"}{"proxy"} ? $_[0]{"_getOptionsArgv"}{"proxy"} : undef
| |||||||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||||||
| 374 | 57 | ▶ | if ( defined $proxy and $proxy ne '' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $proxy and $proxy ne ""
MC/DC50%1/2
defined $proxy and $proxy ne ""
defined $proxy
$proxy ne ""
Truth table66%2/3
A and B
A= defined $proxyB= $proxy ne ""
| |||||||||||||||||||||||||||||||||||||||||||
| 375 | 2 | my ($proxyServer, $proxyNo, $proxyServerNo, $proxyUsername, $proxyPassword, $proxyUsernamePassword); | |||||||||||||||||||||||||||||||||||||||||
| 376 | 2 | ($proxyUsernamePassword, $proxyServerNo) = split(/\@/, $proxy ); | |||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||
| 378 | 2 | ▶ | if ( defined $proxyServerNo ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 379 | 2 | ($proxyUsername, $proxyPassword) = split(/\:/, $proxyUsernamePassword, 2); | |||||||||||||||||||||||||||||||||||||||||
| 380 | 2 | ▶ | $_[0]->printUsage ('Username and/or Password missing: : '. $proxy) unless (defined $proxyUsername and defined $proxyPassword); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $proxyUsername and defined $proxyPassword
MC/DC0%0/2
defined $proxyUsername and defined $proxyPassword
defined $proxyUsername
defined $proxyPassword
Truth table33%1/3
A and B
A= defined $proxyUsernameB= defined $proxyPassword
| |||||||||||||||||||||||||||||||||||||||||||
| 381 | 2 | ($proxyServer, $proxyNo) = split(/\&/, $proxyServerNo ); | |||||||||||||||||||||||||||||||||||||||||
| 382 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 383 | 0 | ($proxyServer, $proxyNo) = split(/\&/, $proxy ); | |||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||
| 386 | 2 | ▶ | $_[0]->[ $_[0]->[0]{_proxy} = @{$_[0]} ] = {} unless ( exists $_[0]->{_proxy} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||
| 388 | 2 | $_[0]->{_proxy}->{server} = "http://" . $proxyServer; | |||||||||||||||||||||||||||||||||||||||||
| 389 | 2 | $_[0]->{_proxy}->{username} = $proxyUsername; | |||||||||||||||||||||||||||||||||||||||||
| 390 | 2 | $_[0]->{_proxy}->{password} = $proxyPassword; | |||||||||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||||||||||
| 392 | 2 | ▶ | $_[0]->{_proxy}->{no} = ( defined $proxyNo ? [ split (/,/, $proxyNo) ] : undef ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | $ENV{NO_PROXY} = ( defined $_[0]->{_proxy}->{no} ? join (', ', @{ $_[0]->{_proxy}->{no} }) : '' ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||
| 396 | # HTTPS: DEFAULT SSL VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 397 | 57 | $ENV{HTTPS_VERSION} = $_[0]->{_SSLversion}; | |||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||
| 399 | # HTTPS: DEBUGGING SWITCH / LOW LEVEL SSL DIAGNOSTICS | ||||||||||||||||||||||||||||||||||||||||||
| 400 | 57 | $ENV{HTTPS_DEBUG} = $_[0]->{_getOptionsValues}->{debug}; | |||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||
| 402 | 57 | ▶ | if ( defined $proxy and $proxy ne '' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $proxy and $proxy ne ""
MC/DC50%1/2
defined $proxy and $proxy ne ""
defined $proxy
$proxy ne ""
Truth table66%2/3
A and B
A= defined $proxyB= $proxy ne ""
| |||||||||||||||||||||||||||||||||||||||||||
| 403 | # HTTPS: PROXY SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 404 | 2 | $ENV{HTTPS_PROXY} = $_[0]->{_proxy}->{server}; | |||||||||||||||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||||||||||||||||
| 406 | # HTTPS: PROXY BASIC_AUTH | ||||||||||||||||||||||||||||||||||||||||||
| 407 | 2 | ▶ | $ENV{HTTPS_PROXY_USERNAME} = $_[0]->{_proxy}->{username} if (defined $_[0]->{_proxy}->{username}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 408 | 2 | ▶ | $ENV{HTTPS_PROXY_PASSWORD} = $_[0]->{_proxy}->{password} if (defined $_[0]->{_proxy}->{password}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 409 | } | ||||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||
| 411 | 57 | ▶ | if (exists $_[0]->{_clientCertificate}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 412 | 4 | ▶ | if (defined $_[0]->{_clientCertificate}->{certFile} and defined $_[0]->{_clientCertificate}->{keyFile}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[0]{"_clientCertificate"}{"certFile"} and defined $_[0]{"_clientCertificate"}{"keyFile"}
MC/DC0%0/2
defined $_[0]{"_clientCertificate"}{"certFile"} and defined $_[0]{"_clientCertificate"}{"keyFile"}
defined $_[0]{"_clientCertificate"}{"certFile"}
defined $_[0]{"_clientCertificate"}{"keyFile"}
Truth table33%1/3
A and B
A= defined $_[0]{"_clientCertificate"}{"certFile"}B= defined $_[0]{"_clientCertificate"}{"keyFile"}
| |||||||||||||||||||||||||||||||||||||||||||
| 413 | # CLIENT CERT SUPPORT, PEM encoded certificate and private key files. | ||||||||||||||||||||||||||||||||||||||||||
| 414 | 4 | $ENV{HTTPS_CERT_FILE} = $_[0]->{_clientCertificate}->{certFile}; | |||||||||||||||||||||||||||||||||||||||||
| 415 | 4 | $ENV{HTTPS_KEY_FILE} = $_[0]->{_clientCertificate}->{keyFile}; | |||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||
| 417 | 4 | ▶ | if (defined $_[0]->{_clientCertificate}->{caFile} and defined $_[0]->{_clientCertificate}->{caDir}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0]{"_clientCertificate"}{"caFile"} and defined $_[0]{"_clientCertificate"}{"caDir"}
MC/DC50%1/2
defined $_[0]{"_clientCertificate"}{"caFile"} and defined $_[0]{"_clientCertificate"}{"caDir"}
defined $_[0]{"_clientCertificate"}{"caFile"}
defined $_[0]{"_clientCertificate"}{"caDir"}
Truth table66%2/3
A and B
A= defined $_[0]{"_clientCertificate"}{"caFile"}B= defined $_[0]{"_clientCertificate"}{"caDir"}
| |||||||||||||||||||||||||||||||||||||||||||
| 418 | # CA CERT PEER VERIFICATION, Additionally, if you would like to tell the client where the CA file is. | ||||||||||||||||||||||||||||||||||||||||||
| 419 | 2 | $ENV{HTTPS_CA_FILE} = $_[0]->{_clientCertificate}->{caFile}; | |||||||||||||||||||||||||||||||||||||||||
| 420 | 2 | $ENV{HTTPS_CA_DIR} = $_[0]->{_clientCertificate}->{caDir}; | |||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||
| 422 | } | ||||||||||||||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||||||||||||||
| 424 | 4 | ▶ | if (defined $_[0]->{_clientCertificate}->{pkcs12File} and defined $_[0]->{_clientCertificate}->{pkcs12Password}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0]{"_clientCertificate"}{"pkcs12File"} and defined $_[0]{"_clientCertificate"}{"pkcs12Password"}
MC/DC50%1/2
defined $_[0]{"_clientCertificate"}{"pkcs12File"} and defined $_[0]{"_clientCertificate"}{"pkcs12Password"}
defined $_[0]{"_clientCertificate"}{"pkcs12File"}
defined $_[0]{"_clientCertificate"}{"pkcs12Password"}
Truth table66%2/3
A and B
A= defined $_[0]{"_clientCertificate"}{"pkcs12File"}B= defined $_[0]{"_clientCertificate"}{"pkcs12Password"}
| |||||||||||||||||||||||||||||||||||||||||||
| 425 | # CLIENT PKCS12 CERT SUPPORT, Use of this type of certificate will take precedence over previous certificate settings described. | ||||||||||||||||||||||||||||||||||||||||||
| 426 | 2 | $ENV{HTTPS_PKCS12_FILE} = $_[0]->{_clientCertificate}->{pkcs12File}; | |||||||||||||||||||||||||||||||||||||||||
| 427 | 2 | $ENV{HTTPS_PKCS12_PASSWORD} = $_[0]->{_clientCertificate}->{pkcs12Password}; | |||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||
| 430 | } | ||||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||
| 432 | # Object accessor methods - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||
| 434 | 123 | ▶ | sub appendPerformanceData { &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; $_[0]->{_pluginValues}->{performanceData} .= ' '. $_[1] if ( defined $_[1] ); } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
appendPerformanceData: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||||||||||
| 436 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||||||||||||||||
| 438 | 24 | ▶ | sub browseragent { &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; $_[0]->{_browseragent} = $_[1] if ( defined $_[1] ); $_[0]->{_browseragent}; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
browseragent: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||||||||||||||
| 440 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||
| 442 | 8 | ▶ | sub SSLversion { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
SSLversion: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 443 | 8 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; | |||||||||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||||||||||
| 445 | 8 | ▶ | if ( defined $_[1] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 446 | 8 | ▶ | $_[0]->{_SSLversion} = ($_[1] =~ /^(?:2|3|23)$/ ? $_[1] : 3); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||||||||||||||
| 449 | 8 | $_[0]->{_SSLversion}; | |||||||||||||||||||||||||||||||||||||||||
| 450 | } | ||||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||
| 452 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||||||||||||||||
| 454 | 26 | ▶ | sub clientCertificate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clientCertificate: called CC=5 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 455 | 26 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs2; | |||||||||||||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||||||||||||
| 457 | 26 | ▶ | if ( defined $_[1] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 458 | 26 | ▶ | if ( defined $_[2] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 459 | 14 | ▶ | $_[0]->{_clientCertificate}->{$_[1]} = $_[2] if ( exists $_[0]->{_clientCertificate}->{$_[1]} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||
| 462 | 26 | ▶ | ( defined $_[0]->{_clientCertificate}->{$_[1]} ) ? $_[0]->{_clientCertificate}->{$_[1]} : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||
| 466 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||
| 468 | 270 | ▶ | sub pluginValue { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pluginValue: called CC=16 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 469 | 270 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs2; | |||||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||||
| 471 | 270 | ▶ | if ( defined $_[1] and exists $_[0]->{_pluginValues}->{$_[1]}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[1] and exists $_[0]{"_pluginValues"}{$_[1]}
MC/DC0%0/2
defined $_[1] and exists $_[0]{"_pluginValues"}{$_[1]}
defined $_[1]
exists $_[0]{"_pluginValues"}{$_[1]}
Truth table33%1/3
A and B
A= defined $_[1]B= exists $_[0]{"_pluginValues"}{$_[1]}
| |||||||||||||||||||||||||||||||||||||||||||
| 472 | 270 | ▶ | if ( exists $_[2] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 473 | 53 | ▶ | if ( $_[1] eq 'stateValue' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 474 | 21 | ▶ | &_dumpValue ( $_[2], 'Wrong value!' ) unless ( defined $_[2] && $_[2] =~ /^[0-3]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[2] and $_[2] =~ /^[0-3]$/
MC/DC0%0/2
defined $_[2] and $_[2] =~ /^[0-3]$/
defined $_[2]
$_[2] =~ /^[0-3]$/
Truth table33%1/3
A and B
A= defined $_[2]B= $_[2] =~ /^[0-3]$/
| |||||||||||||||||||||||||||||||||||||||||||
| 475 | 21 | ▶ | my $stateValue = $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} ? $_[2] : ( $_[0]->{_pluginValues}->{stateValue} > $_[2] ? $_[0]->{_pluginValues}->{stateValue} : $_[2] ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 476 | 21 | $_[0]->{_pluginValues}->{stateValue} = $stateValue; | |||||||||||||||||||||||||||||||||||||||||
| 477 | 21 | $_[0]->{_pluginValues}->{stateError} = $STATE{$stateValue}; | |||||||||||||||||||||||||||||||||||||||||
| 478 | } elsif ( $_[1] eq 'stateError' ) { | ||||||||||||||||||||||||||||||||||||||||||
| 479 | 20 | ▶ | &_dumpValue ( $_[2], 'Wrong value!' ) unless ( defined $_[2] && $_[2] =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[2] and $_[2] =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
MC/DC0%0/2
defined $_[2] and $_[2] =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
defined $_[2]
$_[2] =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
Truth table33%1/3
A and B
A= defined $_[2]B= $_[2] =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 480 | 20 | ▶ | my $stateValue = $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} ? $ERRORS{$_[2]} : ( $_[0]->{_pluginValues}->{stateValue} > $ERRORS{$_[2]} ? $_[0]->{_pluginValues}->{stateValue} : $ERRORS{$_[2]} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 481 | 20 | $_[0]->{_pluginValues}->{stateValue} = $stateValue; | |||||||||||||||||||||||||||||||||||||||||
| 482 | 20 | $_[0]->{_pluginValues}->{stateError} = $STATE{$stateValue}; | |||||||||||||||||||||||||||||||||||||||||
| 483 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 484 | 12 | ▶ | $_[0]->{_pluginValues}->{$_[1]} = $_[2] if ( defined $_[2] ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 485 | } | ||||||||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||||||||||
| 488 | 270 | ▶ | ( defined $_[0]->{_pluginValues}->{$_[1]} ) ? $_[0]->{_pluginValues}->{$_[1]} : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||||
| 492 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||||||||||||
| 494 | 126 | ▶ | sub pluginValues { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pluginValues: called CC=38 SCAR=53.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 495 | 126 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs2; | |||||||||||||||||||||||||||||||||||||||||
| 496 | 126 | ▶ | &_dumpValue ( $_[1], 'Request parameter is not a hash.' ) if ( ref $_[1] ne 'HASH' ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 497 | 126 | ▶ | &_dumpValue ( $_[1], 'Replace/Append value missing!' ) unless (defined $_[2]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||||||
| 499 | 126 | ▶ | if ( exists $_[1]->{stateValue} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 500 | 98 | ▶ | &_dumpValue ( $_[1]->{stateValue}, 'Wrong value!' ) unless ( defined $_[1]->{stateValue} && $_[1]->{stateValue} =~ /^[0-3]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[1]{"stateValue"} and $_[1]{"stateValue"} =~ /^[0-3]$/
MC/DC0%0/2
defined $_[1]{"stateValue"} and $_[1]{"stateValue"} =~ /^[0-3]$/
defined $_[1]{"stateValue"}
$_[1]{"stateValue"} =~ /^[0-3]$/
Truth table33%1/3
A and B
A= defined $_[1]{"stateValue"}B= $_[1]{"stateValue"} =~ /^[0-3]$/
| |||||||||||||||||||||||||||||||||||||||||||
| 501 | 98 | ▶ | my $stateValue = $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} ? $_[1]->{stateValue} : ( $_[0]->{_pluginValues}->{stateValue} > $_[1]->{stateValue} ? $_[0]->{_pluginValues}->{stateValue} : $_[1]->{stateValue} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 502 | 98 | $_[0]->{_pluginValues}->{stateValue} = $stateValue; | |||||||||||||||||||||||||||||||||||||||||
| 503 | 98 | $_[0]->{_pluginValues}->{stateError} = $STATE{$stateValue}; | |||||||||||||||||||||||||||||||||||||||||
| 504 | } elsif ( exists $_[1]->{stateError} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 505 | 20 | ▶ | &_dumpValue ( $_[1]->{stateError}, 'Wrong value!' ) unless ( defined $_[1]->{stateError} && $_[1]->{stateError} =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $_[1]{"stateError"} and $_[1]{"stateError"} =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
MC/DC0%0/2
defined $_[1]{"stateError"} and $_[1]{"stateError"} =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
defined $_[1]{"stateError"}
$_[1]{"stateError"} =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
Truth table33%1/3
A and B
A= defined $_[1]{"stateError"}B= $_[1]{"stateError"} =~ /^(?:OK|WARNING|CRITICAL|UNKNOWN)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 506 | 20 | ▶ | my $stateValue = $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} ? $ERRORS{$_[1]->{stateError}} : ( $_[0]->{_pluginValues}->{stateValue} > $ERRORS{$_[1]->{stateError}} ? $_[0]->{_pluginValues}->{stateValue} : $ERRORS{$_[1]->{stateError}} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 507 | 20 | $_[0]->{_pluginValues}->{stateValue} = $stateValue; | |||||||||||||||||||||||||||||||||||||||||
| 508 | 20 | $_[0]->{_pluginValues}->{stateError} = $STATE{$stateValue}; | |||||||||||||||||||||||||||||||||||||||||
| 509 | } | ||||||||||||||||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||||||||||||||||
| 511 | 126 | ▶ | if ( $_[2] == $TYPE{REPLACE} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 512 | 27 | ▶ | $_[0]->{_pluginValues}->{alert} = $_[1]->{alert} if ( defined $_[1]->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 513 | 27 | ▶ | $_[0]->{_pluginValues}->{error} = $_[1]->{error} if ( defined $_[1]->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 514 | } elsif ( $_[2] == $TYPE{APPEND} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 515 | 99 | ▶ | $_[0]->{_pluginValues}->{alert} .= ( ( defined $_[0]->{_pluginValues}->{alert} ? ' - ' : '' ) .$_[1]->{alert} ) if ( defined $_[1]->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 516 | 99 | ▶ | $_[0]->{_pluginValues}->{error} .= ( ( defined $_[0]->{_pluginValues}->{error} ? ' - ' : '' ) .$_[1]->{error} ) if ( defined $_[1]->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 517 | } elsif ( $_[2] == $TYPE{INSERT} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 518 | 0 | ▶ | $_[0]->{_pluginValues}->{alert} = ( $_[1]->{alert} . ( defined $_[0]->{_pluginValues}->{alert} ? ' - '. $_[0]->{_pluginValues}->{alert} : '' ) ) if ( defined $_[1]->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 519 | 0 | ▶ | $_[0]->{_pluginValues}->{error} = ( $_[1]->{error} . ( defined $_[0]->{_pluginValues}->{error} ? ' - '. $_[0]->{_pluginValues}->{error} : '' ) ) if ( defined $_[1]->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 520 | } elsif ( $_[2] == $TYPE{COMMA_REPLACE} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 521 | # reserved !!! | ||||||||||||||||||||||||||||||||||||||||||
| 522 | } elsif ( $_[2] == $TYPE{COMMA_APPEND} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | ▶ | $_[0]->{_pluginValues}->{alert} .= ( ( defined $_[0]->{_pluginValues}->{alert} ? ', ' : '' ) .$_[1]->{alert} ) if ( defined $_[1]->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | ▶ | $_[0]->{_pluginValues}->{error} .= ( ( defined $_[0]->{_pluginValues}->{error} ? ', ' : '' ) .$_[1]->{error} ) if ( defined $_[1]->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 525 | } elsif ( $_[2] == $TYPE{COMMA_INSERT} ) { | ||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | ▶ | $_[0]->{_pluginValues}->{alert} = ( $_[1]->{alert} . ( defined $_[0]->{_pluginValues}->{alert} ? ', '. $_[0]->{_pluginValues}->{alert} : '' ) ) if ( defined $_[1]->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | ▶ | $_[0]->{_pluginValues}->{error} = ( $_[1]->{error} . ( defined $_[0]->{_pluginValues}->{alert} ? ', '. $_[0]->{_pluginValues}->{error} : '' ) ) if ( defined $_[1]->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||
| 529 | |||||||||||||||||||||||||||||||||||||||||||
| 530 | 126 | ▶ | $_[0]->{_pluginValues}->{result} = $_[1]->{result} if ( defined $_[1]->{result} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||||||||||||||
| 532 | |||||||||||||||||||||||||||||||||||||||||||
| 533 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||
| 535 | 33 | ▶ | sub proxy { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
proxy: called CC=6 SCAR=18.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 536 | 33 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs2; | |||||||||||||||||||||||||||||||||||||||||
| 537 | |||||||||||||||||||||||||||||||||||||||||||
| 538 | 33 | ▶ | if ( defined $_[1] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 539 | 33 | ▶ | if ( exists $_[0]->{_proxy} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 540 | 6 | ▶ | if ( defined $_[2] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 541 | 6 | ▶ | $_[0]->{_proxy}->{$_[1]} = $_[2] if ( exists $_[0]->{_proxy}->{$_[1]} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||||||||||||||||
| 543 | |||||||||||||||||||||||||||||||||||||||||||
| 544 | 6 | ▶ | ( defined $_[0]->{_proxy}->{$_[1]} ) ? $_[0]->{_proxy}->{$_[1]} : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 545 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 546 | 27 | undef; | |||||||||||||||||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||||||||||||||||
| 548 | } | ||||||||||||||||||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||
| 551 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 552 | |||||||||||||||||||||||||||||||||||||||||||
| 553 | 31 | ▶ | sub timeout { &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; $_[0]->{_timeout} = $_[1] if ( defined $_[1] ); $_[0]->{_timeout}; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
timeout: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||||||||||||||||
| 555 | # Class accessor methods - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 556 | |||||||||||||||||||||||||||||||||||||||||||
| 557 | 125 | ▶ | sub setEndTime_and_getResponsTime { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setEndTime_and_getResponsTime: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 558 | 125 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; | |||||||||||||||||||||||||||||||||||||||||
| 559 | |||||||||||||||||||||||||||||||||||||||||||
| 560 | 125 | my ($endTimeSeconds, $endTimeMicroseconds) = gettimeofday(); | |||||||||||||||||||||||||||||||||||||||||
| 561 | 125 | $_[0]->{_pluginValues}->{endTime} = "$endTimeSeconds.$endTimeMicroseconds"; | |||||||||||||||||||||||||||||||||||||||||
| 562 | |||||||||||||||||||||||||||||||||||||||||||
| 563 | 125 | my ($startTimeSeconds, $startTimeMicroseconds) = split (/\./, $_[1]); | |||||||||||||||||||||||||||||||||||||||||
| 564 | 125 | ▶ | $startTimeMicroseconds = 0 unless ( defined $startTimeMicroseconds ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 565 | 125 | ▶ | return ( defined $startTimeSeconds ? int ( ( ( $endTimeSeconds >= $startTimeSeconds ) ? tv_interval ( [$startTimeSeconds, $startTimeMicroseconds], [$endTimeSeconds, $endTimeMicroseconds] ) : tv_interval ( [$endTimeSeconds, $endTimeMicroseconds], [$startTimeSeconds, $startTimeMicroseconds] ) ) * 1000 ) : -1 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 566 | } | ||||||||||||||||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||||||||||||||||
| 568 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||||||||||||||||
| 570 | 0 | ▶ | sub write_debugfile { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
write_debugfile: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 571 | 0 | &_checkAccObjRef ( $_[0] ); &_checkReadOnly2; | |||||||||||||||||||||||||||||||||||||||||
| 572 | |||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | my $debugfile = $_[0]->{_getOptionsArgv}->{debugfile}; | |||||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||||
| 575 | 0 | ▶ | if ( defined $debugfile ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 576 | 0 | ▶ | my $openAppend = ( defined $_[2] and $_[2] =~ /^1$/ ) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $_[2] and $_[2] =~ /^1$/
MC/DC0%0/2
defined $_[2] and $_[2] =~ /^1$/
defined $_[2]
$_[2] =~ /^1$/
Truth table0%0/3
A and B
A= defined $_[2]B= $_[2] =~ /^1$/
| |||||||||||||||||||||||||||||||||||||||||||
| 577 | 0 | ▶ | my $rvOpen = open (DEBUGFILE, ($openAppend ? '>>' : '>') .$debugfile); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 578 | |||||||||||||||||||||||||||||||||||||||||||
| 579 | 0 | ▶ | if ($rvOpen) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | print DEBUGFILE ${$_[1]}, "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 581 | 0 | close(DEBUGFILE); | |||||||||||||||||||||||||||||||||||||||||
| 582 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 583 | 0 | print ref ($_[0]) .": Cannot open $debugfile to print debug information\n"; | |||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||
| 585 | } | ||||||||||||||||||||||||||||||||||||||||||
| 586 | } | ||||||||||||||||||||||||||||||||||||||||||
| 587 | |||||||||||||||||||||||||||||||||||||||||||
| 588 | # Utility methods - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||||||||||||
| 590 | 47 | ▶ | sub printUsage { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
printUsage: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 591 | 47 | ▶ | $_[0]->_getOptions () if ( exists $_[0]->{_getOptionsArgv}->{usage} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 592 | 47 | $_[0]->SUPER::printUsage ($_[1]); | |||||||||||||||||||||||||||||||||||||||||
| 593 | } | ||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||
| 595 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 596 | |||||||||||||||||||||||||||||||||||||||||||
| 597 | 24 | ▶ | sub printHelp { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
printHelp: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 598 | 24 | $_[0]->_getOptions (); | |||||||||||||||||||||||||||||||||||||||||
| 599 | 9 | $_[0]->SUPER::printHelp (); | |||||||||||||||||||||||||||||||||||||||||
| 600 | } | ||||||||||||||||||||||||||||||||||||||||||
| 601 | |||||||||||||||||||||||||||||||||||||||||||
| 602 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 603 | |||||||||||||||||||||||||||||||||||||||||||
| 604 | 4 | ▶ | sub call_system { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
call_system: called CC=9 SCAR=26.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 605 | 4 | &_checkAccObjRef ( $_[0] ); &_checkReadOnly2; | |||||||||||||||||||||||||||||||||||||||||
| 606 | |||||||||||||||||||||||||||||||||||||||||||
| 607 | 4 | ▶ | return ( $ERRORS{DEPENDENT} ) unless ( defined $_[1] ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 608 | 4 | my ($status, $stdout, $stderr) = $_[0]->SUPER::call_system ( $_[1] ); | |||||||||||||||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||||||||||||||||
| 610 | 4 | ▶ | if ( $status ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 611 | 2 | ▶ | if ( $_[0]->{_getOptionsValues}->{debug} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 612 | 0 | ▶ | $_[0]->pluginValues ( { stateValue => $ERRORS{OK}, alert => $_[1] .': OK', result => ( defined $stdout ? $stdout : undef ) }, $TYPE{APPEND} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 613 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 614 | 2 | ▶ | $_[0]->pluginValues ( { stateValue => $ERRORS{OK}, result => ( defined $stdout ? $stdout : undef ) }, $TYPE{APPEND} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 615 | } | ||||||||||||||||||||||||||||||||||||||||||
| 616 | |||||||||||||||||||||||||||||||||||||||||||
| 617 | 2 | return ( $ERRORS{OK} ); | |||||||||||||||||||||||||||||||||||||||||
| 618 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 619 | 2 | ▶ | if ( $_[0]->{_getOptionsValues}->{debug} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 620 | 0 | ▶ | $_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, result => ( defined $stderr ? $stderr : undef ) }, $TYPE{APPEND} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 621 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 622 | 2 | ▶ | $_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => $_[1] .': '. $stderr, result => ( defined $stderr ? $stderr : undef ) }, $TYPE{APPEND} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 623 | } | ||||||||||||||||||||||||||||||||||||||||||
| 624 | |||||||||||||||||||||||||||||||||||||||||||
| 625 | 2 | return ( $ERRORS{UNKNOWN} ); | |||||||||||||||||||||||||||||||||||||||||
| 626 | } | ||||||||||||||||||||||||||||||||||||||||||
| 627 | } | ||||||||||||||||||||||||||||||||||||||||||
| 628 | |||||||||||||||||||||||||||||||||||||||||||
| 629 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||||||||||||||||
| 631 | 29 | ▶ | sub exit { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
exit: called CC=47 SCAR=66.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 632 | 29 | &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; | |||||||||||||||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||||||||||||||||
| 634 | 29 | ▶ | exit $ERRORS { $_[0]->{_pluginValues}->{stateError} } if ( exists $_[0]->{_exit_} and $_[0]->{_exit_} == 1 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 1
MC/DC0%0/2
exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 1
exists $_[0]{"_exit_"}
$_[0]{"_exit_"} == 1
Truth table33%1/3
A and B
A= exists $_[0]{"_exit_"}B= $_[0]{"_exit_"} == 1
| |||||||||||||||||||||||||||||||||||||||||||
| 635 | |||||||||||||||||||||||||||||||||||||||||||
| 636 | # Timing Out Slow Plugins - part 2/2 - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 637 | |||||||||||||||||||||||||||||||||||||||||||
| 638 | 29 | ▶ | if ( exists $_[0]->{_getOptionsArgv}->{timeout} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 639 | 0 | my $remaining = alarm (0); | |||||||||||||||||||||||||||||||||||||||||
| 640 | |||||||||||||||||||||||||||||||||||||||||||
| 641 | 0 | ▶ | if ( $ALARM_OFF or $! =~ /\QASNMTAP::Asnmtap::Plugins::ALARM_OFF = 1\n\E/ or $@ =~ /\QASNMTAP::Asnmtap::Plugins::ALARM_OFF = 1\n\E/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$ASNMTAP::Asnmtap::Plugins::ALARM_OFF or $! =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/ or $@ =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
$ASNMTAP::Asnmtap::Plugins::ALARM_OFF or $! =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
MC/DC0%0/3
$ASNMTAP::Asnmtap::Plugins::ALARM_OFF or $! =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/ or $@ =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
$ASNMTAP::Asnmtap::Plugins::ALARM_OFF
$! =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
$@ =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
Truth table0%0/4
A or B or C
A= $ASNMTAP::Asnmtap::Plugins::ALARM_OFFB= $! =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/C= $@ =~ /ASNMTAP\:\:Asnmtap\:\:Plugins\:\:ALARM_OFF\ \=\ 1\\n/
| |||||||||||||||||||||||||||||||||||||||||||
| 642 | 0 | $_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => "TIMING OUT SLOW PLUGIN ($remaining)" }, $TYPE{APPEND} ); | |||||||||||||||||||||||||||||||||||||||||
| 643 | 0 | $remaining = 0; | |||||||||||||||||||||||||||||||||||||||||
| 644 | } | ||||||||||||||||||||||||||||||||||||||||||
| 645 | |||||||||||||||||||||||||||||||||||||||||||
| 646 | 0 | ▶ | $SIG{ALRM} = $_[0]->{_pluginValues}->{_handler_} ? $_[0]->{_pluginValues}->{_handler_} : 'DEFAULT'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 647 | |||||||||||||||||||||||||||||||||||||||||||
| 648 | 0 | ▶ | if ( $_[0]->{_pluginValues}->{_alarm_} ) { # Previous alarm pending | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 649 | 0 | my $alarm = $_[0]->{_pluginValues}->{_alarm_} - $_[0]->{_getOptionsArgv}->{timeout} + $remaining; | |||||||||||||||||||||||||||||||||||||||||
| 650 | |||||||||||||||||||||||||||||||||||||||||||
| 651 | 0 | ▶ | if ( $alarm > 0 ) { # Reset it, excluding the elapsed time | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 652 | 0 | alarm ($alarm); | |||||||||||||||||||||||||||||||||||||||||
| 653 | } else { # It should have gone off already, set it off | ||||||||||||||||||||||||||||||||||||||||||
| 654 | 0 | kill 'ALRM',$$; | |||||||||||||||||||||||||||||||||||||||||
| 655 | } | ||||||||||||||||||||||||||||||||||||||||||
| 656 | } | ||||||||||||||||||||||||||||||||||||||||||
| 657 | } | ||||||||||||||||||||||||||||||||||||||||||
| 658 | |||||||||||||||||||||||||||||||||||||||||||
| 659 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 660 | |||||||||||||||||||||||||||||||||||||||||||
| 661 | 29 | ▶ | $_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'HELP, THERE IS A PROBLEM WITH THE PLUGIN' }, $TYPE{APPEND} ) if ( $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} or ( exists $_[0]->{_exit_} and $_[0]->{_exit_} == 2 ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$_[0]{"_pluginValues"}{"stateValue"} == $ASNMTAP::Asnmtap::Plugins::ERRORS{"DEPENDENT"} or exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 2
exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 2
MC/DC0%0/3
$_[0]{"_pluginValues"}{"stateValue"} == $ASNMTAP::Asnmtap::Plugins::ERRORS{"DEPENDENT"} or exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 2
$_[0]{"_pluginValues"}{"stateValue"} == $ASNMTAP::Asnmtap::Plugins::ERRORS{"DEPENDENT"}
exists $_[0]{"_exit_"}
$_[0]{"_exit_"} == 2
Truth table25%1/4
A or B and C
A= $_[0]{"_pluginValues"}{"stateValue"} == $ASNMTAP::Asnmtap::Plugins::ERRORS{"DEPENDENT"}B= exists $_[0]{"_exit_"}C= $_[0]{"_exit_"} == 2
| |||||||||||||||||||||||||||||||||||||||||||
| 662 | |||||||||||||||||||||||||||||||||||||||||||
| 663 | 29 | ▶ | $_[0]->appendPerformanceData('Status='. $_[0]->{_pluginValues}->{stateValue} .';1;2;0;3') if ( defined $_[1] && $_[1] =~ /^[1357]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[1] and $_[1] =~ /^[1357]$/
MC/DC50%1/2
defined $_[1] and $_[1] =~ /^[1357]$/
defined $_[1]
$_[1] =~ /^[1357]$/
Truth table66%2/3
A and B
A= defined $_[1]B= $_[1] =~ /^[1357]$/
| |||||||||||||||||||||||||||||||||||||||||||
| 664 | |||||||||||||||||||||||||||||||||||||||||||
| 665 | 29 | my $duration = $_[0]->setEndTime_and_getResponsTime ($_[0]->{_pluginValues}->{startTime}); | |||||||||||||||||||||||||||||||||||||||||
| 666 | 29 | ▶ | $_[0]->appendPerformanceData('Compilation='. ($_[0]->setEndTime_and_getResponsTime ($^T) - $duration) .'ms;;;0;') if ( $_[1] =~ /^[2367]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||||
| 668 | 29 | ▶ | if ( $_[0]->{_getOptionsArgv}->{trendline} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 669 | 0 | my $responseTimeSeconds = ( $duration / 1000 ); # convert to seconds | |||||||||||||||||||||||||||||||||||||||||
| 670 | |||||||||||||||||||||||||||||||||||||||||||
| 671 | 0 | ▶ | if ( $_[0]->{_getOptionsValues}->{debug} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 672 | 0 | my ($startTimeEpoch, undef) = split (/\./, $_[0]->{_pluginValues}->{startTime}); | |||||||||||||||||||||||||||||||||||||||||
| 673 | 0 | my ($endTimeEpoch, undef) = split (/\./, $_[0]->{_pluginValues}->{endTime}); | |||||||||||||||||||||||||||||||||||||||||
| 674 | 0 | print "\nStart time : ", scalar(localtime($startTimeEpoch)), "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 675 | 0 | print "End time : ", scalar(localtime($endTimeEpoch)), "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 676 | 0 | print "Trendline : ". $_[0]->{_getOptionsArgv}->{trendline} ."\n"; | |||||||||||||||||||||||||||||||||||||||||
| 677 | 0 | print "Response time: $responseTimeSeconds\n"; | |||||||||||||||||||||||||||||||||||||||||
| 678 | } | ||||||||||||||||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||||||||||||||||
| 680 | 0 | ▶ | if ( $_[0]->{_pluginValues}->{stateValue} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 681 | 0 | $_[0]->appendPerformanceData('Trendline='. $responseTimeSeconds .'s;;;;'); | |||||||||||||||||||||||||||||||||||||||||
| 682 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 683 | 0 | $_[0]->appendPerformanceData('Trendline='. $responseTimeSeconds .'s;'. $_[0]->{_getOptionsArgv}->{trendline} .';;;'); | |||||||||||||||||||||||||||||||||||||||||
| 684 | 0 | ▶ | $_[0]->{_pluginValues}->{alert} = "Response time $responseTimeSeconds > trendline ". $_[0]->{_getOptionsArgv}->{trendline} if ( $responseTimeSeconds > $_[0]->{_getOptionsArgv}->{trendline} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 685 | } | ||||||||||||||||||||||||||||||||||||||||||
| 686 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 687 | 29 | ▶ | $_[0]->appendPerformanceData('Duration='. $duration .'ms;;;0;') if ( $_[1] =~ /^[2367]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 688 | } | ||||||||||||||||||||||||||||||||||||||||||
| 689 | |||||||||||||||||||||||||||||||||||||||||||
| 690 | 29 | ▶ | $_[0]->{_pluginValues}->{alert} =~ s/^\s+//g if ( defined $_[0]->{_pluginValues}->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||||||||||||||||
| 692 | 29 | ▶ | if ( $_[0]->{_getOptionsValues}->{debug} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 693 | 0 | ▶ | print "\nStatus : ". $_[0]->{_getOptionsArgv}->{status} ."\n" if ( defined $_[0]->{_getOptionsArgv}->{status} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 694 | 0 | ▶ | print "Debug : ". $_[0]->{_getOptionsValues}->{debug} ."\n" if ( defined $_[0]->{_getOptionsValues}->{debug} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 695 | 0 | ▶ | print "Logging : ". $_[0]->{_getOptionsArgv}->{logging} ."\n" if ( defined $_[0]->{_getOptionsArgv}->{logging} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 696 | 0 | ▶ | print "Httpdump : ". $_[0]->{_getOptionsArgv}->{debugfile} ."\n" if ( defined $_[0]->{_getOptionsArgv}->{debugfile} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 697 | 0 | ▶ | print "State : ". $_[0]->{_pluginValues}->{stateError} ."\n" if ( defined $_[0]->{_pluginValues}->{stateError} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 698 | 0 | ▶ | print "Message : ". $_[0]->{_pluginValues}->{message} ."\n" if ( defined $_[0]->{_pluginValues}->{message} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 699 | 0 | ▶ | print "Alert : ". $_[0]->{_pluginValues}->{alert} ."\n" if ( defined $_[0]->{_pluginValues}->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 700 | 0 | ▶ | print "Error : ". $_[0]->{_pluginValues}->{error} ."\n" if ( defined $_[0]->{_pluginValues}->{error} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 701 | 0 | print "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 702 | } | ||||||||||||||||||||||||||||||||||||||||||
| 703 | |||||||||||||||||||||||||||||||||||||||||||
| 704 | 29 | my $returnMessage = $_[0]->{_pluginValues}->{stateError} .' - '. $_[0]->{_pluginValues}->{message} .':'; | |||||||||||||||||||||||||||||||||||||||||
| 705 | 29 | ▶ | $returnMessage .= ' '. $_[0]->{_pluginValues}->{alert} if ( $_[0]->{_pluginValues}->{alert} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 706 | 29 | ▶ | $returnMessage .= ' ERROR: '. $_[0]->{_pluginValues}->{error} if (defined $_[0]->{_pluginValues}->{error}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 707 | |||||||||||||||||||||||||||||||||||||||||||
| 708 | 29 | ▶ | $_[0]->appendPerformanceData('Execution='. $_[0]->setEndTime_and_getResponsTime ($^T) .'ms;;;0;') if ( $_[1] =~ /^[2367]$/ ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 709 | |||||||||||||||||||||||||||||||||||||||||||
| 710 | 29 | ▶ | if ( defined $_[0]->{_pluginValues}->{performanceData} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 711 | 27 | $_[0]->{_pluginValues}->{performanceData} =~ s/^\s+//g; | |||||||||||||||||||||||||||||||||||||||||
| 712 | 27 | $returnMessage .= '|'. $_[0]->{_pluginValues}->{performanceData}; | |||||||||||||||||||||||||||||||||||||||||
| 713 | } | ||||||||||||||||||||||||||||||||||||||||||
| 714 | |||||||||||||||||||||||||||||||||||||||||||
| 715 | 29 | ▶ | if ( $_[0]->{_getOptionsArgv}->{logging} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 716 | 0 | ▶ | unless ( $CAPTUREOUTPUT ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 717 | 0 | ▶ | my $loggedStatus = ( $_[0]->{_getOptionsArgv}->{debugfile} ) ? $_[0]->{_getOptionsArgv}->{debugfile} : $_[0]->{_getOptionsArgv}->{logging}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 718 | 0 | $loggedStatus .= "-status.txt"; | |||||||||||||||||||||||||||||||||||||||||
| 719 | |||||||||||||||||||||||||||||||||||||||||||
| 720 | 0 | my $rvOpen = open( LOGGING, ">$loggedStatus" ); | |||||||||||||||||||||||||||||||||||||||||
| 721 | |||||||||||||||||||||||||||||||||||||||||||
| 722 | 0 | ▶ | if ($rvOpen) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 723 | 0 | print LOGGING "$returnMessage\n"; | |||||||||||||||||||||||||||||||||||||||||
| 724 | 0 | close(LOGGING); | |||||||||||||||||||||||||||||||||||||||||
| 725 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 726 | 0 | print "Cannot open $loggedStatus to print debug information\n"; | |||||||||||||||||||||||||||||||||||||||||
| 727 | } | ||||||||||||||||||||||||||||||||||||||||||
| 728 | } | ||||||||||||||||||||||||||||||||||||||||||
| 729 | |||||||||||||||||||||||||||||||||||||||||||
| 730 | 0 | ▶ | if ( $_[0]->{_getOptionsValues}->{boolean_debug_all} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 731 | 0 | my $rvOpen = open ( LOGGING, '>>'. $_[0]->{_getOptionsArgv}->{logging} .'-all.txt' ); | |||||||||||||||||||||||||||||||||||||||||
| 732 | |||||||||||||||||||||||||||||||||||||||||||
| 733 | 0 | ▶ | if ($rvOpen) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 734 | 0 | print LOGGING "--> $returnMessage\n"; | |||||||||||||||||||||||||||||||||||||||||
| 735 | 0 | ▶ | print LOGGING ' -> '. $_[0]->{_pluginValues}->{error} ."\n" if ( $_[0]->{_pluginValues}->{error} ne 'SUCCESS' ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 736 | 0 | close(LOGGING); | |||||||||||||||||||||||||||||||||||||||||
| 737 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 738 | 0 | print 'Cannot open '. $_[0]->{_getOptionsArgv}->{logging} ."-all.txt to print debug information\n"; | |||||||||||||||||||||||||||||||||||||||||
| 739 | } | ||||||||||||||||||||||||||||||||||||||||||
| 740 | } | ||||||||||||||||||||||||||||||||||||||||||
| 741 | |||||||||||||||||||||||||||||||||||||||||||
| 742 | 0 | ▶ | if ( $_[0]->{_getOptionsValues}->{boolean_debug_NOK} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 743 | 0 | ▶ | if ( $_[0]->{_pluginValues}->{stateValue} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 744 | 0 | my $rvOpen = open ( LOGGING, '>'. $_[0]->{_getOptionsArgv}->{logging} .'-nok.txt' ); | |||||||||||||||||||||||||||||||||||||||||
| 745 | |||||||||||||||||||||||||||||||||||||||||||
| 746 | 0 | ▶ | if ( $rvOpen ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 747 | 0 | print LOGGING "--> $returnMessage\n"; | |||||||||||||||||||||||||||||||||||||||||
| 748 | 0 | print LOGGING ' -> '. $_[0]->{_pluginValues}->{error} ."\n"; | |||||||||||||||||||||||||||||||||||||||||
| 749 | 0 | print LOGGING ' > '. $_[0]->{_pluginValues}->{result} ."\n"; | |||||||||||||||||||||||||||||||||||||||||
| 750 | 0 | close(LOGGING); | |||||||||||||||||||||||||||||||||||||||||
| 751 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 752 | 0 | print "Cannot open ". $_[0]->{_getOptionsArgv}->{logging} ."-nok.txt to print debug information\n"; | |||||||||||||||||||||||||||||||||||||||||
| 753 | } | ||||||||||||||||||||||||||||||||||||||||||
| 754 | } | ||||||||||||||||||||||||||||||||||||||||||
| 755 | } | ||||||||||||||||||||||||||||||||||||||||||
| 756 | } | ||||||||||||||||||||||||||||||||||||||||||
| 757 | |||||||||||||||||||||||||||||||||||||||||||
| 758 | 29 | ▶ | $_[0]->dumpData (1) if ( $_[0]->getOptionsArgv ('dumpData') ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 759 | |||||||||||||||||||||||||||||||||||||||||||
| 760 | 29 | ▶ | print "$returnMessage\n" if ( $_[0]->{_plugins} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 761 | 29 | $_[0]->{_exit_} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 762 | 29 | exit $ERRORS { $_[0]->{_pluginValues}->{stateError} }; | |||||||||||||||||||||||||||||||||||||||||
| 763 | } | ||||||||||||||||||||||||||||||||||||||||||
| 764 | |||||||||||||||||||||||||||||||||||||||||||
| 765 | # Destructor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 766 | |||||||||||||||||||||||||||||||||||||||||||
| 767 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||
| 768 | 0 | ▶ | print (ref ($_[0]), "::DESTROY: ()\n") if ( $_[0]->{_debug} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 769 | |||||||||||||||||||||||||||||||||||||||||||
| 770 | 0 | ▶ | if ( exists $_[0]->{_pluginValues} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 771 | 0 | ▶ | unless ( exists $_[0]->{_exit_} and $_[0]->{_exit_} == 1 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 1
MC/DC0%0/2
exists $_[0]{"_exit_"} and $_[0]{"_exit_"} == 1
exists $_[0]{"_exit_"}
$_[0]{"_exit_"} == 1
Truth table0%0/3
A and B
A= exists $_[0]{"_exit_"}B= $_[0]{"_exit_"} == 1
| |||||||||||||||||||||||||||||||||||||||||||
| 772 | 0 | $_[0]->{_exit_} = 2; | |||||||||||||||||||||||||||||||||||||||||
| 773 | 0 | $_[0]->exit(0); | |||||||||||||||||||||||||||||||||||||||||
| 774 | } | ||||||||||||||||||||||||||||||||||||||||||
| 775 | } | ||||||||||||||||||||||||||||||||||||||||||
| 776 | |||||||||||||||||||||||||||||||||||||||||||
| 777 | 0 | $_[0]->{_exit_} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 778 | 0 | $_[0]->exit(0); | |||||||||||||||||||||||||||||||||||||||||
| 779 | } | ||||||||||||||||||||||||||||||||||||||||||
| 780 | |||||||||||||||||||||||||||||||||||||||||||
| 781 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 782 | |||||||||||||||||||||||||||||||||||||||||||
| 783 | 102 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 784 | |||||||||||||||||||||||||||||||||||||||||||
| 785 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||
| 786 | |||||||||||||||||||||||||||||||||||||||||||
| 787 | __END__ | ||||||||||||||||||||||||||||||||||||||||||