[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1775] Nagios-Plugin/trunk

tonvoon at users.sourceforge.net tonvoon at users.sourceforge.net
Tue Sep 4 15:17:01 CEST 2007


Revision: 1775
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1775&view=rev
Author:   tonvoon
Date:     2007-09-04 06:17:01 -0700 (Tue, 04 Sep 2007)

Log Message:
-----------
Fixed CPAN test failures due to bad MANIFEST. Fixed version numbering
Fixed a performance parsing problem where uom=% wasn't being recognised

Modified Paths:
--------------
    Nagios-Plugin/trunk/Changes
    Nagios-Plugin/trunk/MANIFEST
    Nagios-Plugin/trunk/META.yml
    Nagios-Plugin/trunk/lib/Nagios/Plugin/Functions.pm
    Nagios-Plugin/trunk/lib/Nagios/Plugin/Performance.pm
    Nagios-Plugin/trunk/lib/Nagios/Plugin.pm
    Nagios-Plugin/trunk/t/Nagios-Plugin-Performance.t

Removed Paths:
-------------
    Nagios-Plugin/trunk/.cvsignore

Deleted: Nagios-Plugin/trunk/.cvsignore
===================================================================
--- Nagios-Plugin/trunk/.cvsignore	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/.cvsignore	2007-09-04 13:17:01 UTC (rev 1775)
@@ -1,5 +0,0 @@
-Makefile
-blib
-pm_to_blib
-.bzr
-.bzrignore

Modified: Nagios-Plugin/trunk/Changes
===================================================================
--- Nagios-Plugin/trunk/Changes	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/Changes	2007-09-04 13:17:01 UTC (rev 1775)
@@ -1,5 +1,10 @@
 Revision history for Perl module Nagios::Plugin.
 
+0.19  4th September 2007
+  - Fix test failures due to bad MANIFEST file
+  - Fixed performance parsing where uom = %
+  - Fixed version numbering
+
 0.18  31st August 2007
   - Fix error when parsing performance data where warn or crit are 0
   - Optional _use_die flag to force nagios_die to call die instead of exit, so

Modified: Nagios-Plugin/trunk/MANIFEST
===================================================================
--- Nagios-Plugin/trunk/MANIFEST	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/MANIFEST	2007-09-04 13:17:01 UTC (rev 1775)
@@ -1,15 +1,18 @@
 Changes
-Makefile.PL
-MANIFEST
-META.yml
-README
 lib/Nagios/Plugin.pm
+lib/Nagios/Plugin/Config.pm
+lib/Nagios/Plugin/ExitResult.pm
+lib/Nagios/Plugin/Functions.pm
+lib/Nagios/Plugin/Getopt.pm
 lib/Nagios/Plugin/Performance.pm
 lib/Nagios/Plugin/Range.pm
 lib/Nagios/Plugin/Threshold.pm
-lib/Nagios/Plugin/Functions.pm
-lib/Nagios/Plugin/Getopt.pm
-lib/Nagios/Plugin/ExitResult.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+t/check_stuff.pl
+t/check_stuff.t
 t/Nagios-Plugin-01.t
 t/Nagios-Plugin-02.t
 t/Nagios-Plugin-03.t
@@ -21,12 +24,10 @@
 t/Nagios-Plugin-Getopt-02.t
 t/Nagios-Plugin-Getopt-03.t
 t/Nagios-Plugin-Getopt-04.t
+t/Nagios-Plugin-Performance-02.t
 t/Nagios-Plugin-Performance.t
 t/Nagios-Plugin-Range.t
 t/Nagios-Plugin-Threshold.t
-t/check_stuff.pl
-t/check_stuff.t
-t/npg03/README
 t/npg03/expected/00_basic
 t/npg03/expected/00_noextra
 t/npg03/expected/01_override1
@@ -54,3 +55,4 @@
 t/npg03/input/13_nosection_explicit_dies
 t/npg03/input/14_badsection_dies
 t/npg03/plugins.ini
+t/npg03/README

Modified: Nagios-Plugin/trunk/META.yml
===================================================================
--- Nagios-Plugin/trunk/META.yml	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/META.yml	2007-09-04 13:17:01 UTC (rev 1775)
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Nagios-Plugin
-version:      0.17
+version:      0.19
 version_from: lib/Nagios/Plugin/Functions.pm
 installdirs:  site
 requires:

Modified: Nagios-Plugin/trunk/lib/Nagios/Plugin/Functions.pm
===================================================================
--- Nagios-Plugin/trunk/lib/Nagios/Plugin/Functions.pm	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/lib/Nagios/Plugin/Functions.pm	2007-09-04 13:17:01 UTC (rev 1775)
@@ -12,7 +12,7 @@
 use Math::Calc::Units;
 
 # Remember to update Nagios::Plugins as well
-our $VERSION = 0.17;
+our $VERSION = 0.19;
 
 our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);
 

Modified: Nagios-Plugin/trunk/lib/Nagios/Plugin/Performance.pm
===================================================================
--- Nagios-Plugin/trunk/lib/Nagios/Plugin/Performance.pm	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/lib/Nagios/Plugin/Performance.pm	2007-09-04 13:17:01 UTC (rev 1775)
@@ -25,7 +25,7 @@
 sub _parse {
 	my $class = shift;
 	my $string = shift;
-	$string =~ s/^([^=]+)=([\d\.]+)(\w*);?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?\s*//;
+	$string =~ s/^([^=]+)=([\d\.]+)([\w%]*);?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?;?([\d\.]+)?\s*//;
 	return undef unless ((defined $1 && $1 ne "") && (defined $2 && $2 ne ""));
     my $p = $class->new(
         label => $1, value => $2+0, uom => $3, warning => $4, critical => $5, 

Modified: Nagios-Plugin/trunk/lib/Nagios/Plugin.pm
===================================================================
--- Nagios-Plugin/trunk/lib/Nagios/Plugin.pm	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/lib/Nagios/Plugin.pm	2007-09-04 13:17:01 UTC (rev 1775)
@@ -24,7 +24,8 @@
 
 # CPAN stupidly won't index this module without a literal $VERSION here,
 #   so we're forced to duplicate it explicitly
-our $VERSION = 0.17;
+# Make sure you update $Nagios::Plugin::Functions::VERSION too
+our $VERSION = 0.19;
 # our $VERSION = $Nagios::Plugin::Functions::VERSION;
 
 sub new {

Modified: Nagios-Plugin/trunk/t/Nagios-Plugin-Performance.t
===================================================================
--- Nagios-Plugin/trunk/t/Nagios-Plugin-Performance.t	2007-08-31 14:35:22 UTC (rev 1774)
+++ Nagios-Plugin/trunk/t/Nagios-Plugin-Performance.t	2007-09-04 13:17:01 UTC (rev 1775)
@@ -1,6 +1,6 @@
 
 use strict;
-use Test::More tests => 84;
+use Test::More tests => 91;
 BEGIN { use_ok('Nagios::Plugin::Performance') };
 
 diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE};
@@ -133,4 +133,13 @@
 cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay");
 cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay");
 
+ at p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95");
+cmp_ok( $p[0]->label, "eq", "pct_used", "label okay");
+cmp_ok( $p[0]->value, "eq", "73.7", "value okay");
+cmp_ok( $p[0]->uom, "eq", "%", "uom okay");
+    ok( defined eval { $p[0]->threshold->warning->is_set }, "Warning range has been set");
+    ok( defined eval { $p[0]->threshold->critical->is_set }, "Critical range has been set");
+cmp_ok( $p[0]->threshold->warning, 'eq', "90", "warn okay");
+cmp_ok( $p[0]->threshold->critical, 'eq', "95", "crit okay");
+
 # add_perfdata tests in t/Nagios-Plugin-01.t


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list