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
|
|
41
|
use 5.006; |
|
3
|
|
|
|
|
9
|
|
6
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
60
|
|
7
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
127
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Stringify to message |
10
|
3
|
|
|
3
|
|
13
|
use overload '""' => sub { shift->{message} }; |
|
3
|
|
|
36
|
|
3
|
|
|
3
|
|
|
|
|
27
|
|
|
36
|
|
|
|
|
7102
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor |
13
|
|
|
|
|
|
|
sub new { |
14
|
92
|
|
|
92
|
0
|
138
|
my $class = shift; |
15
|
92
|
|
|
|
|
555
|
return bless { return_code => $_[0], message => $_[1] }, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Accessors |
19
|
86
|
|
|
86
|
0
|
1958
|
sub message { shift->{message} } |
20
|
76
|
|
|
76
|
0
|
651
|
sub return_code { shift->{return_code} } |
21
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |