summaryrefslogtreecommitdiffstats
path: root/lib/Nagios/Plugin/Functions.pm
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2008-05-14 11:19:53 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2008-05-14 11:19:53 (GMT)
commitc47e1a9c28db2890f724ee57e59f3a3c30d7740c (patch)
tree5648f0b0ff1a1eb2478f75484a26e3fa42e1f455 /lib/Nagios/Plugin/Functions.pm
parent60a00b6e423bfeeca3508398556e180955355079 (diff)
downloadmonitoring-plugin-perl-c47e1a9c28db2890f724ee57e59f3a3c30d7740c.tar.gz
Fixed parsing of scientific notation
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1993 f882894a-f735-0410-b71e-b25c423dba1c
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 };