| 1 | package Nagios::Plugin::CheckHost::Result; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | sub new { | ||||||||||
| 7 | 8 | ▶ | my ($class, %args) = @_; | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 8 | |||||||||||
| 9 | 8 | ▶ | my $nodes = delete $args{nodes} or die "Missed nodes information"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | 8 | my %nodes = map {$_->identifier => $_} @$nodes; | |||||||||
| 11 | 8 | bless {%args, nodes => \%nodes, results => {}}, $class; | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | sub store_result { | ||||||||||
| 15 | 8 | ▶ | my ($self, $results) = @_; | ||||||||
|
Subroutine
store_result: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 16 | 8 | foreach my $node (keys %$results) { | |||||||||
| 17 | 24 | ▶ | my $node_c = $self->{nodes}{$node} or next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | |||||||||||
| 19 | 24 | my $r = $results->{$node}; | |||||||||
| 20 | |||||||||||
| 21 | 24 | ▶ | if (defined $r->[0]) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 22 | $self->{results}{$node_c} = $r; | |||||||||
| 23 | } else { | ||||||||||
| 24 | 2 | delete $self->{nodes}{$node}; | |||||||||
| 25 | } | ||||||||||
| 26 | } | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | sub unfinished_nodes { | ||||||||||
| 30 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
unfinished_nodes: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 31 | 0 | my @nodes; | |||||||||
| 32 | |||||||||||
| 33 | 0 | foreach my $node (values %{$self->{nodes}}) { | |||||||||
| 34 | 0 | ▶ | push @nodes, $node unless exists $self->{results}{$node}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | @nodes; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub nodes { | ||||||||||
| 41 | 8 | ▶ | values %{$_[0]->{nodes}}; | ||||||||
|
Subroutine
nodes: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 2 | 1; | |||||||||