summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2007-09-04 13:17:01 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2007-09-04 13:17:01 +0000
commit3ec5d3b8b2426a9acce2faa23a58e615af62930f (patch)
tree544b1c26587ced6c82b992fc151c66981dc35e81
parent819c55cfdd0c26069229ec27a02576d4169defdb (diff)
downloadmonitoring-plugin-perl-3ec5d3b8b2426a9acce2faa23a58e615af62930f.tar.gz
Fixed CPAN test failures due to bad MANIFEST. Fixed version numbering
Fixed a performance parsing problem where uom=% wasn't being recognised git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1775 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--.cvsignore5
-rw-r--r--Changes5
-rw-r--r--MANIFEST22
-rw-r--r--META.yml2
-rw-r--r--lib/Nagios/Plugin.pm3
-rw-r--r--lib/Nagios/Plugin/Functions.pm2
-rw-r--r--lib/Nagios/Plugin/Performance.pm2
-rw-r--r--t/Nagios-Plugin-Performance.t11
8 files changed, 32 insertions, 20 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 96e6eb3..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
1Makefile
2blib
3pm_to_blib
4.bzr
5.bzrignore
diff --git a/Changes b/Changes
index c1f17ab..88f8274 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
1Revision history for Perl module Nagios::Plugin. 1Revision history for Perl module Nagios::Plugin.
2 2
30.19 4th September 2007
4 - Fix test failures due to bad MANIFEST file
5 - Fixed performance parsing where uom = %
6 - Fixed version numbering
7
30.18 31st August 2007 80.18 31st August 2007
4 - Fix error when parsing performance data where warn or crit are 0 9 - Fix error when parsing performance data where warn or crit are 0
5 - Optional _use_die flag to force nagios_die to call die instead of exit, so 10 - Optional _use_die flag to force nagios_die to call die instead of exit, so
diff --git a/MANIFEST b/MANIFEST
index ce5186e..39be2c5 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,15 +1,18 @@
1Changes 1Changes
2Makefile.PL
3MANIFEST
4META.yml
5README
6lib/Nagios/Plugin.pm 2lib/Nagios/Plugin.pm
3lib/Nagios/Plugin/Config.pm
4lib/Nagios/Plugin/ExitResult.pm
5lib/Nagios/Plugin/Functions.pm
6lib/Nagios/Plugin/Getopt.pm
7lib/Nagios/Plugin/Performance.pm 7lib/Nagios/Plugin/Performance.pm
8lib/Nagios/Plugin/Range.pm 8lib/Nagios/Plugin/Range.pm
9lib/Nagios/Plugin/Threshold.pm 9lib/Nagios/Plugin/Threshold.pm
10lib/Nagios/Plugin/Functions.pm 10Makefile.PL
11lib/Nagios/Plugin/Getopt.pm 11MANIFEST This list of files
12lib/Nagios/Plugin/ExitResult.pm 12META.yml
13README
14t/check_stuff.pl
15t/check_stuff.t
13t/Nagios-Plugin-01.t 16t/Nagios-Plugin-01.t
14t/Nagios-Plugin-02.t 17t/Nagios-Plugin-02.t
15t/Nagios-Plugin-03.t 18t/Nagios-Plugin-03.t
@@ -21,12 +24,10 @@ t/Nagios-Plugin-Getopt-01.t
21t/Nagios-Plugin-Getopt-02.t 24t/Nagios-Plugin-Getopt-02.t
22t/Nagios-Plugin-Getopt-03.t 25t/Nagios-Plugin-Getopt-03.t
23t/Nagios-Plugin-Getopt-04.t 26t/Nagios-Plugin-Getopt-04.t
27t/Nagios-Plugin-Performance-02.t
24t/Nagios-Plugin-Performance.t 28t/Nagios-Plugin-Performance.t
25t/Nagios-Plugin-Range.t 29t/Nagios-Plugin-Range.t
26t/Nagios-Plugin-Threshold.t 30t/Nagios-Plugin-Threshold.t
27t/check_stuff.pl
28t/check_stuff.t
29t/npg03/README
30t/npg03/expected/00_basic 31t/npg03/expected/00_basic
31t/npg03/expected/00_noextra 32t/npg03/expected/00_noextra
32t/npg03/expected/01_override1 33t/npg03/expected/01_override1
@@ -54,3 +55,4 @@ t/npg03/input/12_nosection_implicit
54t/npg03/input/13_nosection_explicit_dies 55t/npg03/input/13_nosection_explicit_dies
55t/npg03/input/14_badsection_dies 56t/npg03/input/14_badsection_dies
56t/npg03/plugins.ini 57t/npg03/plugins.ini
58t/npg03/README
diff --git a/META.yml b/META.yml
index 8067a7b..f03239e 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
1# http://module-build.sourceforge.net/META-spec.html 1# http://module-build.sourceforge.net/META-spec.html
2#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# 2#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
3name: Nagios-Plugin 3name: Nagios-Plugin
4version: 0.17 4version: 0.19
5version_from: lib/Nagios/Plugin/Functions.pm 5version_from: lib/Nagios/Plugin/Functions.pm
6installdirs: site 6installdirs: site
7requires: 7requires:
diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm
index fe83575..cdd3396 100644
--- a/lib/Nagios/Plugin.pm
+++ b/lib/Nagios/Plugin.pm
@@ -24,7 +24,8 @@ our @EXPORT_OK = qw(%ERRORS);
24 24
25# CPAN stupidly won't index this module without a literal $VERSION here, 25# CPAN stupidly won't index this module without a literal $VERSION here,
26# so we're forced to duplicate it explicitly 26# so we're forced to duplicate it explicitly
27our $VERSION = 0.17; 27# Make sure you update $Nagios::Plugin::Functions::VERSION too
28our $VERSION = 0.19;
28# our $VERSION = $Nagios::Plugin::Functions::VERSION; 29# our $VERSION = $Nagios::Plugin::Functions::VERSION;
29 30
30sub new { 31sub new {
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm
index e8b292e..318b2cb 100644
--- a/lib/Nagios/Plugin/Functions.pm
+++ b/lib/Nagios/Plugin/Functions.pm
@@ -12,7 +12,7 @@ use Params::Validate qw(validate :types);
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.17; 15our $VERSION = 0.19;
16 16
17our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); 17our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);
18 18
diff --git a/lib/Nagios/Plugin/Performance.pm b/lib/Nagios/Plugin/Performance.pm
index 7ce5fa1..55e3ddc 100644
--- a/lib/Nagios/Plugin/Performance.pm
+++ b/lib/Nagios/Plugin/Performance.pm
@@ -25,7 +25,7 @@ sub import {
25sub _parse { 25sub _parse {
26 my $class = shift; 26 my $class = shift;
27 my $string = shift; 27 my $string = shift;
28 $string =~ s/^([^=]+)=([\d\.]+)(\w*);?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?\s*//; 28 $string =~ s/^([^=]+)=([\d\.]+)([\w%]*);?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?\s*//;
29 return undef unless ((defined $1 && $1 ne "") && (defined $2 && $2 ne "")); 29 return undef unless ((defined $1 && $1 ne "") && (defined $2 && $2 ne ""));
30 my $p = $class->new( 30 my $p = $class->new(
31 label => $1, value => $2+0, uom => $3, warning => $4, critical => $5, 31 label => $1, value => $2+0, uom => $3, warning => $4, critical => $5,
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index c4d518c..0574ea0 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 84; 3use Test::More tests => 91;
4BEGIN { use_ok('Nagios::Plugin::Performance') }; 4BEGIN { use_ok('Nagios::Plugin::Performance') };
5 5
6diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; 6diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE};
@@ -133,4 +133,13 @@ cmp_ok( $p[0]->uom, "eq", "s", "uom okay");
133cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); 133cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay");
134cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); 134cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay");
135 135
136@p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95");
137cmp_ok( $p[0]->label, "eq", "pct_used", "label okay");
138cmp_ok( $p[0]->value, "eq", "73.7", "value okay");
139cmp_ok( $p[0]->uom, "eq", "%", "uom okay");
140 ok( defined eval { $p[0]->threshold->warning->is_set }, "Warning range has been set");
141 ok( defined eval { $p[0]->threshold->critical->is_set }, "Critical range has been set");
142cmp_ok( $p[0]->threshold->warning, 'eq', "90", "warn okay");
143cmp_ok( $p[0]->threshold->critical, 'eq', "95", "crit okay");
144
136# add_perfdata tests in t/Nagios-Plugin-01.t 145# add_perfdata tests in t/Nagios-Plugin-01.t