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
|
3
|
|
|
3
|
|
14
|
use strict;
|
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
167
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Stringify to message
|
8
|
3
|
|
|
3
|
|
16
|
use overload '""' => sub { shift->{message} };
|
|
3
|
|
|
36
|
|
9
|
|
|
3
|
|
|
|
|
33
|
|
|
36
|
|
|
|
|
3413
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Constructor
|
11
|
|
|
|
|
|
|
sub new {
|
12
|
89
|
|
|
89
|
0
|
119
|
my $class = shift;
|
13
|
89
|
|
|
|
|
548
|
return bless { return_code => $_[0], message => $_[1] }, $class;
|
14
|
|
|
|
|
|
|
}
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Accessors
|
17
|
83
|
|
|
83
|
0
|
1829
|
sub message { shift->{message} }
|
18
|
76
|
|
|
76
|
0
|
817
|
sub return_code { shift->{return_code} }
|
19
|
0
|
|
|
0
|
0
|
|
sub code { shift->{return_code} }
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1;
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__
|