line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitoring::Plugin::ExitResult; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Tiny helper class to return both output and return_code when testing |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
71
|
use 5.006; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
137
|
|
6
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
120
|
|
7
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
201
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Stringify to message |
10
|
3
|
|
|
3
|
|
19
|
use overload '""' => sub { shift->{message} }; |
|
3
|
|
|
36
|
|
4
|
|
|
3
|
|
|
|
|
34
|
|
|
36
|
|
|
|
|
5019
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor |
13
|
|
|
|
|
|
|
sub new { |
14
|
89
|
|
|
89
|
0
|
146
|
my $class = shift; |
15
|
89
|
|
|
|
|
982
|
return bless { return_code => $_[0], message => $_[1] }, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Accessors |
19
|
83
|
|
|
83
|
0
|
3548
|
sub message { shift->{message} } |
20
|
76
|
|
|
76
|
0
|
1555
|
sub return_code { shift->{return_code} } |
21
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |