line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Tiny helper class to return both output and return_code when testing |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Nagios::Monitoring::Plugin::ExitResult; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
135
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Stringify to message |
8
|
2
|
|
|
2
|
|
16
|
use overload '""' => sub { shift->{message} }; |
|
2
|
|
|
21
|
|
3
|
|
|
2
|
|
|
|
|
24
|
|
|
21
|
|
|
|
|
2089
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Constructor |
11
|
|
|
|
|
|
|
sub new { |
12
|
48
|
|
|
48
|
0
|
63
|
my $class = shift; |
13
|
48
|
|
|
|
|
335
|
return bless { return_code => $_[0], message => $_[1] }, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Accessors |
17
|
42
|
|
|
42
|
0
|
1044
|
sub message { shift->{message} } |
18
|
38
|
|
|
38
|
0
|
379
|
sub return_code { shift->{return_code} } |
19
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |