line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Nagios::Plugin::CheckHost::Result; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
469
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
8
|
|
|
8
|
0
|
13581
|
my ($class, %args) = @_; |
8
|
|
|
|
|
|
|
|
9
|
8
|
50
|
|
|
|
29
|
my $nodes = delete $args{nodes} or die "Missed nodes information"; |
10
|
8
|
|
|
|
|
15
|
my %nodes = map {$_->identifier => $_} @$nodes; |
|
24
|
|
|
|
|
45
|
|
11
|
8
|
|
|
|
|
39
|
bless {%args, nodes => \%nodes, results => {}}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub store_result { |
15
|
8
|
|
|
8
|
0
|
12
|
my ($self, $results) = @_; |
16
|
8
|
|
|
|
|
36
|
foreach my $node (keys %$results) { |
17
|
24
|
50
|
|
|
|
48
|
my $node_c = $self->{nodes}{$node} or next; |
18
|
|
|
|
|
|
|
|
19
|
24
|
|
|
|
|
22
|
my $r = $results->{$node}; |
20
|
|
|
|
|
|
|
|
21
|
24
|
100
|
|
|
|
38
|
if (defined $r->[0]) { |
22
|
22
|
|
|
|
|
54
|
$self->{results}{$node_c} = $r; |
23
|
|
|
|
|
|
|
} else { |
24
|
2
|
|
|
|
|
7
|
delete $self->{nodes}{$node}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub unfinished_nodes { |
30
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
31
|
0
|
|
|
|
|
0
|
my @nodes; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
foreach my $node (values %{$self->{nodes}}) { |
|
0
|
|
|
|
|
0
|
|
34
|
0
|
0
|
|
|
|
0
|
push @nodes, $node unless exists $self->{results}{$node}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
@nodes; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub nodes { |
41
|
8
|
|
|
8
|
0
|
8
|
values %{$_[0]->{nodes}}; |
|
8
|
|
|
|
|
37
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |