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
|
|
56
|
use 5.006; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
91
|
|
6
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
74
|
|
7
|
3
|
|
|
3
|
|
9
|
use warnings; |
|
3
|
|
|
|
|
2
|
|
|
3
|
|
|
|
|
123
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Stringify to message |
10
|
3
|
|
|
3
|
|
9
|
use overload '""' => sub { shift->{message} }; |
|
3
|
|
|
36
|
|
3
|
|
|
3
|
|
|
|
|
22
|
|
|
36
|
|
|
|
|
2568
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor |
13
|
|
|
|
|
|
|
sub new { |
14
|
89
|
|
|
89
|
0
|
82
|
my $class = shift; |
15
|
89
|
|
|
|
|
432
|
return bless { return_code => $_[0], message => $_[1] }, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Accessors |
19
|
83
|
|
|
83
|
0
|
1730
|
sub message { shift->{message} } |
20
|
76
|
|
|
76
|
0
|
621
|
sub return_code { shift->{return_code} } |
21
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |