Branch Coverage

blib/lib/Monitoring/GLPlugin/Commandline.pm
Criterion Covered Total %
branch 6 242 2.4


line true false branch
20 2 1 unless grep /BEGIN/, keys %Monitoring::GLPlugin::Commandline::Getopt::
46 0 6 if $AUTOLOAD =~ /DESTROY/
48 0 6 if $self->{'opts'}->verbose >= 2
49 6 0 if ($AUTOLOAD =~ /^.*::(add_arg|override_opt|create_opt)$/)
64 0 0 -f $tracefile ? :
65 0 0 if ($self->opts->verbose and $self->opts->verbose > 10)
70 0 0 if ($self->{'trace'})
73 0 0 if ($logfh->open($tracefile, 'a'))
94 31 0 if $code =~ /^\d+$/
101 0 0 if ($self->opts->can('selectedperfdata') and $self->opts->selectedperfdata) { }
103 0 0 $label =~ /$pattern/i ? :
127 0 0 if ($self->opts->can('morphperfdata') and $self->opts->morphperfdata)
130 0 0 if ($label =~ /$key/)
134 0 0 if (exists $self->{'thresholds'}{$oldlabel})
140 0 0 if ($value =~ /\./) { }
141 0 0 if (defined $args{'places'}) { }
151 0 0 defined $args{'min'} ? :
152 0 0 defined $args{'max'} ? :
153 0 0 if ($args{'thresholds'} or not exists $args{'warning'} || exists $args{'critical'}) { }
154 0 0 if (exists $self->{'thresholds'}{$label}{'warning'}) { }
0 0 elsif (exists $self->{'thresholds'}{'default'}{'warning'}) { }
159 0 0 if (exists $self->{'thresholds'}{$label}{'critical'}) { }
0 0 elsif (exists $self->{'thresholds'}{'default'}{'critical'}) { }
165 0 0 if ($args{'warning'})
168 0 0 if ($args{'critical'})
172 0 0 if ($uom eq '%')
176 0 0 if (defined $args{'places'})
179 0 0 if ($warn ne '')
185 0 0 /[\+\-\d\.]+/ ? :
188 0 0 if ($crit ne '')
194 0 0 /[\+\-\d\.]+/ ? :
197 0 0 if ($min ne '')
203 0 0 /[\+\-\d\.]+/ ? :
206 0 0 if ($max ne '')
212 0 0 /[\+\-\d\.]+/ ? :
216 0 0 if $self->selected_perfdata($label)
233 0 0 if $code =~ /^\d+$/
241 0 0 if ($self->opts->report and $self->opts->report eq 'short')
243 0 0 if not $self->check_messages
251 0 0 if not $self->check_messages
260 0 0 if ($args{$code}) { }
261 0 0 unless (ref $args{$code} eq 'ARRAY')
262 0 0 if ($code eq 'ok')
272 0 0 unless defined $arg{'join'}
276 0 0 if @{$arg{'critical'};}
277 0 0 if @{$arg{'warning'};}
278 0 0 if @{$arg{'unknown'};}
279 0 0 unless wantarray
283 0 0 if ($arg{'join_all'}) { }
285 0 0 @$_ ? :
289 0 0 ref $arg{'ok'} ? :
0 0 $arg{'ok'} ? :
294 0 0 if $code == 2
296 0 0 if $code == 1
298 0 0 if $code == 3
301 0 0 ref $arg{'ok'} ? :
0 0 if $arg{'ok'}
309 0 0 if $code =~ /^\d+$/
311 0 0 if defined $code and exists $ERRORS{$code}
312 0 0 unless defined $code and exists $STATUS_TEXT{$code}
318 0 0 if (scalar @{$self->{'perfdata'};}) { }
327 0 0 if (scalar @{$self->{'html'};}) { }
336 0 0 if defined $code and exists $ERRORS{$code}
337 0 0 unless defined $code and exists $STATUS_TEXT{$code}
338 0 0 unless defined $message
339 0 0 if (ref $message and ref $message eq 'ARRAY') { }
344 0 0 if ($self->opts->negate)
347 0 0 if (uc($from) =~ /^(OK|WARNING|CRITICAL|UNKNOWN)$/ and uc($self->opts->negate->{$from}) =~ /^(OK|WARNING|CRITICAL|UNKNOWN)$/)
349 0 0 if ($original_code == $ERRORS{uc $from})
356 0 0 if defined $message and $message ne ''
357 0 0 if ($self->opts->can('morphmessage') and $self->opts->morphmessage)
361 0 0 if ($output =~ /$key/)
367 0 0 if $output
368 0 0 if (scalar @{$self->{'perfdata'};})
372 0 0 if ($self->opts->can('isvalidtime') and not $self->opts->isvalidtime)
377 0 0 unless (exists $self->{'suppress_messages'})
385 0 0 if (exists $params{'metric'}) { }
391 0 0 if (defined $self->opts->warning)
394 0 0 if (defined $self->opts->critical)
398 0 0 if ($self->opts->warningx)
406 0 0 if ($key =~ /\*/) { }
413 0 0 unless $metric =~ /$key/
419 0 0 if $key ne $metric
424 0 0 if ($self->opts->criticalx)
429 0 0 if ($key =~ /\*/) { }
436 0 0 unless $metric =~ /$key/
442 0 0 if $key ne $metric
449 0 0 defined $params{'warning'} ? :
0 0 defined $self->opts->warning ? :
451 0 0 defined $params{'critical'} ? :
0 0 defined $self->opts->critical ? :
457 0 0 if (exists $params{'metric'}) { }
469 0 0 if (scalar @params > 1) { }
486 0 0 if (scalar @params > 1) { }
490 0 0 if ($metric ne 'default') { }
493 0 0 exists $self->{'thresholds'}{$metric}{'warning'} ? :
496 0 0 exists $self->{'thresholds'}{$metric}{'critical'} ? :
499 0 0 defined $params{'warning'} ? :
501 0 0 defined $params{'critical'} ? :
508 0 0 if (not defined $warningrange) { }
0 0 elsif ($warningrange =~ /^([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($warningrange =~ /^([-+]?[0-9]*\.?[0-9]+):$/) { }
0 0 elsif ($warningrange =~ /^~:([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($warningrange =~ /^([-+]?[0-9]*\.?[0-9]+):([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($warningrange =~ /^@([-+]?[0-9]*\.?[0-9]+):([-+]?[0-9]*\.?[0-9]+)$/) { }
513 0 0 if $value > $1 or $value < 0
517 0 0 if $value < $1
521 0 0 if $value > $1
525 0 0 if $value < $1 or $value > $2
529 0 0 if $value >= $1 and $value <= $2
531 0 0 if (not defined $criticalrange) { }
0 0 elsif ($criticalrange =~ /^([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($criticalrange =~ /^([-+]?[0-9]*\.?[0-9]+):$/) { }
0 0 elsif ($criticalrange =~ /^~:([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($criticalrange =~ /^([-+]?[0-9]*\.?[0-9]+):([-+]?[0-9]*\.?[0-9]+)$/) { }
0 0 elsif ($criticalrange =~ /^@([-+]?[0-9]*\.?[0-9]+):([-+]?[0-9]*\.?[0-9]+)$/) { }
536 0 0 if $value > $1 or $value < 0
540 0 0 if $value < $1
544 0 0 if $value > $1
548 0 0 if $value < $1 or $value > $2
552 0 0 if $value >= $1 and $value <= $2