diff options
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | META.yml | 2 | ||||
-rw-r--r-- | lib/Monitoring/Plugin.pm | 2 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Functions.pm | 2 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Getopt.pm | 6 | ||||
-rw-r--r-- | t/Monitoring-Plugin-Getopt-03.t | 5 |
6 files changed, 13 insertions, 7 deletions
@@ -1,5 +1,8 @@ | |||
1 | Revision history for Perl module Monitoring::Plugin. | 1 | Revision history for Perl module Monitoring::Plugin. |
2 | 2 | ||
3 | 0.38 28th December 2014 | ||
4 | - fix getopt test on windows system | ||
5 | |||
3 | 0.37 20nd January 2014 | 6 | 0.37 20nd January 2014 |
4 | - renamed module due to trademark issues | 7 | - renamed module due to trademark issues |
5 | 8 | ||
@@ -33,4 +33,4 @@ requires: | |||
33 | resources: | 33 | resources: |
34 | license: http://dev.perl.org/licenses/ | 34 | license: http://dev.perl.org/licenses/ |
35 | repository: https://github.com/monitoring-plugins/monitoring-plugin-perl | 35 | repository: https://github.com/monitoring-plugins/monitoring-plugin-perl |
36 | version: 0.37 | 36 | version: 0.38 |
diff --git a/lib/Monitoring/Plugin.pm b/lib/Monitoring/Plugin.pm index a5b51b1..8c30cc6 100644 --- a/lib/Monitoring/Plugin.pm +++ b/lib/Monitoring/Plugin.pm | |||
@@ -26,7 +26,7 @@ our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT); | |||
26 | # CPAN stupidly won't index this module without a literal $VERSION here, | 26 | # CPAN stupidly won't index this module without a literal $VERSION here, |
27 | # so we're forced to duplicate it explicitly | 27 | # so we're forced to duplicate it explicitly |
28 | # Make sure you update $Monitoring::Plugin::Functions::VERSION too | 28 | # Make sure you update $Monitoring::Plugin::Functions::VERSION too |
29 | our $VERSION = "0.37"; | 29 | our $VERSION = "0.38"; |
30 | 30 | ||
31 | sub new { | 31 | sub new { |
32 | my $class = shift; | 32 | my $class = shift; |
diff --git a/lib/Monitoring/Plugin/Functions.pm b/lib/Monitoring/Plugin/Functions.pm index d362f9c..34483e1 100644 --- a/lib/Monitoring/Plugin/Functions.pm +++ b/lib/Monitoring/Plugin/Functions.pm | |||
@@ -12,7 +12,7 @@ use Params::Validate qw(:types validate); | |||
12 | use Math::Calc::Units; | 12 | use Math::Calc::Units; |
13 | 13 | ||
14 | # Remember to update Monitoring::Plugins as well | 14 | # Remember to update Monitoring::Plugins as well |
15 | our $VERSION = "0.37"; | 15 | our $VERSION = "0.38"; |
16 | 16 | ||
17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); | 17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); |
18 | 18 | ||
diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm index 3575ce6..db98567 100644 --- a/lib/Monitoring/Plugin/Getopt.pm +++ b/lib/Monitoring/Plugin/Getopt.pm | |||
@@ -41,7 +41,7 @@ my @ARGS = ({ | |||
41 | help => "-V, --version\n Print version information", | 41 | help => "-V, --version\n Print version information", |
42 | }, { | 42 | }, { |
43 | spec => 'extra-opts:s@', | 43 | spec => 'extra-opts:s@', |
44 | help => "--extra-opts=[section][\@file]\n Read options from an ini file. See http://nagiosplugins.org/extra-opts\n for usage and examples.", | 44 | help => "--extra-opts=[section][\@file]\n Read options from an ini file. See https://www.monitoring-plugins.org/doc/extra-opts.html\n for usage and examples.", |
45 | }, { | 45 | }, { |
46 | spec => 'timeout|t=i', | 46 | spec => 'timeout|t=i', |
47 | help => "-t, --timeout=INTEGER\n Seconds before plugin times out (default: %s)", | 47 | help => "-t, --timeout=INTEGER\n Seconds before plugin times out (default: %s)", |
@@ -534,8 +534,8 @@ processing for Nagios plugins | |||
534 | $ng->getopts; | 534 | $ng->getopts; |
535 | 535 | ||
536 | # Access arguments using named accessors or or via the generic get() | 536 | # Access arguments using named accessors or or via the generic get() |
537 | print $ng->warning; | 537 | print $ng->opts->warning; |
538 | print $ng->get('critical'); | 538 | print $ng->opts->get('critical'); |
539 | 539 | ||
540 | 540 | ||
541 | 541 | ||
diff --git a/t/Monitoring-Plugin-Getopt-03.t b/t/Monitoring-Plugin-Getopt-03.t index 6490145..bcf324e 100644 --- a/t/Monitoring-Plugin-Getopt-03.t +++ b/t/Monitoring-Plugin-Getopt-03.t | |||
@@ -97,7 +97,10 @@ for my $infile (glob File::Spec->catfile($tdir, 'input', $glob)) { | |||
97 | if ($@) { | 97 | if ($@) { |
98 | chomp $@; | 98 | chomp $@; |
99 | ok($infile =~ m/_(dies?|catch)$/, "$infile ($@)"); | 99 | ok($infile =~ m/_(dies?|catch)$/, "$infile ($@)"); |
100 | is($@, $EXPECTED{$infile}, $infile) if ($infile =~ m/_catch$/); | 100 | my $expect = $EXPECTED{$infile}; |
101 | # windows expects backslashes fixes rt.cpan #100708 | ||
102 | $expect =~ s#/#\\#gmx if $^O =~ m/^MSWin/; | ||
103 | is($@, $expect, $infile) if ($infile =~ m/_catch$/); | ||
101 | } | 104 | } |
102 | else { | 105 | else { |
103 | is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile); | 106 | is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile); |