line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Nagios::NRPE::Utils - Common helper functions for Nagios::NRPE |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 DESCRIPTION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
This file contains common helper functions for the submodules |
8
|
|
|
|
|
|
|
Nagios::NRPE::Client, Nagios::NRPE::Packet and Nagios::NRPE::Daemon. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
This software is copyright (c) 2013-2018 by the authors (see L file). |
13
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
14
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 METHODS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=over |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=item return_error |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Create a hash with the specified error message using this format |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
|
|
|
|
|
|
error => 1, |
26
|
|
|
|
|
|
|
reason => "some reason" |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=back |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
package Nagios::NRPE::Utils; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our $VERSION = '2.0.13'; |
36
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
37
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
141
|
|
38
|
|
|
|
|
|
|
require Exporter; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
41
|
|
|
|
|
|
|
our @EXPORT_OK = qw(return_error); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub return_error { |
44
|
2
|
|
|
2
|
1
|
5
|
my ($reason) = @_; |
45
|
2
|
|
|
|
|
3
|
my %return; |
46
|
2
|
|
|
|
|
4
|
$return{'error'} = 1; |
47
|
2
|
|
|
|
|
5
|
$return{'reason'} = $reason; |
48
|
2
|
|
|
|
|
5
|
return ( \%return ); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |