summaryrefslogtreecommitdiffstats
path: root/lib/Nagios/Plugin/Functions.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r--lib/Nagios/Plugin/Functions.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm
index 57c5b08..a37cdaf 100644
--- a/lib/Nagios/Plugin/Functions.pm
+++ b/lib/Nagios/Plugin/Functions.pm
@@ -12,14 +12,14 @@ use Params::Validate qw(:types validate);
12use Math::Calc::Units; 12use Math::Calc::Units;
13 13
14# Remember to update Nagios::Plugins as well 14# Remember to update Nagios::Plugins as well
15our $VERSION = "0.26"; 15our $VERSION = "0.27";
16 16
17our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); 17our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);
18 18
19require Exporter; 19require Exporter;
20our @ISA = qw(Exporter); 20our @ISA = qw(Exporter);
21our @EXPORT = (@STATUS_CODES, qw(nagios_exit nagios_die check_messages)); 21our @EXPORT = (@STATUS_CODES, qw(nagios_exit nagios_die check_messages));
22our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT @STATUS_CODES get_shortname max_state convert); 22our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT @STATUS_CODES get_shortname max_state convert $value_re);
23our %EXPORT_TAGS = ( 23our %EXPORT_TAGS = (
24 all => [ @EXPORT, @EXPORT_OK ], 24 all => [ @EXPORT, @EXPORT_OK ],
25 codes => [ @STATUS_CODES ], 25 codes => [ @STATUS_CODES ],
@@ -42,6 +42,9 @@ our %ERRORS = (
42 42
43our %STATUS_TEXT = reverse %ERRORS; 43our %STATUS_TEXT = reverse %ERRORS;
44 44
45my $value = qr/[-+]?[\d\.]+/;
46our $value_re = qr/$value(?:e$value)?/;
47
45# _fake_exit flag and accessor/mutator, for testing 48# _fake_exit flag and accessor/mutator, for testing
46my $_fake_exit = 0; 49my $_fake_exit = 0;
47sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit }; 50sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit };