| 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<AUTHORS|https://github.com/stockholmuniversity/Nagios-NRPE/blob/master/AUTHORS> 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 | 1 | our $VERSION = '2.0.12'; | |
| 36 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 38 | 1 | require Exporter; | |
| 39 | |||
| 40 | 1 | our @ISA = qw(Exporter); | |
| 41 | 1 | our @EXPORT_OK = qw(return_error); | |
| 42 | |||
| 43 | sub return_error { | ||
| 44 | 2 | ▶ | my ($reason) = @_; |
|
Subroutine
return_error: called CC=1 SCAR=0.0
Pod
documented
| |||
| 45 | 2 | my %return; | |
| 46 | 2 | $return{'error'} = 1; | |
| 47 | 2 | $return{'reason'} = $reason; | |
| 48 | 2 | return ( \%return ); | |
| 49 | |||
| 50 | } | ||
| 51 | |||
| 52 | 1 | 1; | |