diff options
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r-- | lib/Nagios/Plugin/Functions.pm | 7 |
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); | |||
12 | use Math::Calc::Units; | 12 | use Math::Calc::Units; |
13 | 13 | ||
14 | # Remember to update Nagios::Plugins as well | 14 | # Remember to update Nagios::Plugins as well |
15 | our $VERSION = "0.26"; | 15 | our $VERSION = "0.27"; |
16 | 16 | ||
17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); | 17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); |
18 | 18 | ||
19 | require Exporter; | 19 | require Exporter; |
20 | our @ISA = qw(Exporter); | 20 | our @ISA = qw(Exporter); |
21 | our @EXPORT = (@STATUS_CODES, qw(nagios_exit nagios_die check_messages)); | 21 | our @EXPORT = (@STATUS_CODES, qw(nagios_exit nagios_die check_messages)); |
22 | our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT @STATUS_CODES get_shortname max_state convert); | 22 | our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT @STATUS_CODES get_shortname max_state convert $value_re); |
23 | our %EXPORT_TAGS = ( | 23 | our %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 | ||
43 | our %STATUS_TEXT = reverse %ERRORS; | 43 | our %STATUS_TEXT = reverse %ERRORS; |
44 | 44 | ||
45 | my $value = qr/[-+]?[\d\.]+/; | ||
46 | our $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 |
46 | my $_fake_exit = 0; | 49 | my $_fake_exit = 0; |
47 | sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit }; | 50 | sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit }; |