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::Plugin::ExitResult; |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
199
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Stringify to message |
8
|
3
|
|
|
3
|
|
15
|
use overload '""' => sub { shift->{message} }; |
|
3
|
|
|
36
|
|
79
|
|
|
3
|
|
|
|
|
30
|
|
|
36
|
|
|
|
|
4086
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Constructor |
11
|
|
|
|
|
|
|
sub new { |
12
|
89
|
|
|
89
|
0
|
134
|
my $class = shift; |
13
|
89
|
|
|
|
|
783
|
return bless { return_code => $_[0], message => $_[1] }, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Accessors |
17
|
83
|
|
|
83
|
0
|
2601
|
sub message { shift->{message} } |
18
|
76
|
|
|
76
|
0
|
989
|
sub return_code { shift->{return_code} } |
19
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |