| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Nagios::Plugin; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
84067
|
use strict; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
197
|
|
|
4
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
165
|
|
|
5
|
5
|
|
|
5
|
|
1299
|
use Nagios::Plugin::Functions qw(:codes %ERRORS %STATUS_TEXT @STATUS_CODES); |
|
|
5
|
|
|
|
|
14
|
|
|
|
5
|
|
|
|
|
1142
|
|
|
6
|
5
|
|
|
5
|
|
26
|
use base 'Monitoring::Plugin'; |
|
|
5
|
|
|
|
|
6
|
|
|
|
5
|
|
|
|
|
3154
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
24280
|
use Exporter; |
|
|
5
|
|
|
|
|
10
|
|
|
|
5
|
|
|
|
|
547
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
|
10
|
|
|
|
|
|
|
our @EXPORT = (@STATUS_CODES); |
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT); |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# CPAN stupidly won't index this module without a literal $VERSION here, |
|
14
|
|
|
|
|
|
|
# so we're forced to duplicate it explicitly |
|
15
|
|
|
|
|
|
|
# Make sure you update $Nagios::Plugin::Functions::VERSION too |
|
16
|
|
|
|
|
|
|
our $VERSION = "0.37"; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
BEGIN { |
|
19
|
5
|
|
|
5
|
|
8
|
our $deprecated_warned = 0; |
|
20
|
5
|
50
|
|
|
|
19
|
warnings::warnif("deprecated", "Nagios::Plugin is deprecated, use Monitoring::Plugin instead.") |
|
21
|
|
|
|
|
|
|
unless $Monitoring::Plugin::deprecated_warned; |
|
22
|
5
|
|
|
|
|
1770
|
$deprecated_warned = 1; |
|
23
|
|
|
|
|
|
|
}; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# MP::Functions wrappers |
|
26
|
|
|
|
|
|
|
sub nagios_exit { |
|
27
|
19
|
|
|
19
|
0
|
16919
|
my $self = shift; |
|
28
|
19
|
|
|
|
|
79
|
return(Nagios::Plugin::Functions::nagios_exit(@_, { plugin => $self })); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
sub nagios_die { |
|
31
|
23
|
|
|
23
|
0
|
22795
|
my $self = shift; |
|
32
|
23
|
|
|
|
|
90
|
return(Nagios::Plugin::Functions::nagios_die(@_, { plugin => $self })); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
sub die { |
|
35
|
6
|
|
|
6
|
0
|
4493
|
my $self = shift; |
|
36
|
6
|
|
|
|
|
25
|
return(Nagios::Plugin::Functions::nagios_die(@_, { plugin => $self })); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
sub max_state { |
|
39
|
0
|
|
|
0
|
0
|
0
|
return(Monitoring::Plugin::Functions::max_state(@_)); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
sub max_state_alt { |
|
42
|
0
|
|
|
0
|
0
|
0
|
return(Monitoring::Plugin::Functions::max_state_alt(@_)); |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
sub new { |
|
45
|
24
|
|
|
24
|
0
|
18005
|
return(Monitoring::Plugin::new(@_)); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
sub shortname { |
|
48
|
57
|
|
|
57
|
0
|
2761
|
return(Monitoring::Plugin::shortname(@_)); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
sub check_messages { |
|
51
|
30
|
|
|
30
|
0
|
18382
|
return(Monitoring::Plugin::check_messages(@_)); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
sub set_thresholds { |
|
54
|
6
|
|
|
6
|
0
|
1098
|
return(Monitoring::Plugin::set_thresholds(@_)); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
sub opts { |
|
57
|
19
|
|
|
19
|
0
|
19935
|
return(Monitoring::Plugin::opts(@_)); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
sub threshold { |
|
60
|
37
|
|
|
37
|
0
|
8897
|
return(Monitoring::Plugin::threshold(@_)); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
sub perfdata { |
|
63
|
106
|
|
|
106
|
0
|
3210
|
return(Monitoring::Plugin::perfdata(@_)); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
sub messages { |
|
66
|
118
|
|
|
118
|
0
|
1016
|
return(Monitoring::Plugin::messages(@_)); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
sub add_message { |
|
69
|
18
|
|
|
18
|
0
|
2347
|
return(Monitoring::Plugin::add_message(@_)); |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
sub add_perfdata { |
|
72
|
2
|
|
|
2
|
0
|
1055
|
return(Monitoring::Plugin::add_perfdata(@_)); |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
sub all_perfoutput { |
|
75
|
56
|
|
|
56
|
0
|
780
|
return(Monitoring::Plugin::all_perfoutput(@_)); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
sub add_arg { |
|
78
|
3
|
|
|
3
|
0
|
497
|
return(Monitoring::Plugin::add_arg(@_)); |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
sub _check_for_opts { |
|
81
|
5
|
|
|
5
|
|
29
|
return(Monitoring::Plugin::_check_for_opts(@_)); |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
sub getopts { |
|
84
|
2
|
|
|
2
|
0
|
546
|
return(Monitoring::Plugin::getopts(@_)); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
sub check_threshold { |
|
87
|
20
|
|
|
20
|
0
|
9624
|
return(Monitoring::Plugin::check_threshold(@_)); |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |