[Nagiosplug-checkins] Nagios-Plugin/lib/Nagios/Plugin Functions.pm, 1.1, 1.2

Gavin Carr gonzai at users.sourceforge.net
Tue Sep 26 06:10:39 CEST 2006


Update of /cvsroot/nagiosplug/Nagios-Plugin/lib/Nagios/Plugin
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11863/lib/Nagios/Plugin

Modified Files:
	Functions.pm 
Log Message:
Update Nagios::Plugin with NP::Function wrapper methods, and extras.

Index: Functions.pm
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/lib/Nagios/Plugin/Functions.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Functions.pm	26 Sep 2006 01:10:23 -0000	1.1
+++ Functions.pm	26 Sep 2006 04:10:36 -0000	1.2
@@ -14,7 +14,7 @@
 require Exporter;
 our @ISA = qw(Exporter);
 our @EXPORT = (@STATUS_CODES, qw(nagios_exit nagios_die check_messages));
-our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT);
+our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT @STATUS_CODES);
 our %EXPORT_TAGS = (
     all => [ @EXPORT, @EXPORT_OK ],
     codes => [ @STATUS_CODES ],
@@ -28,7 +28,7 @@
 use constant DEPENDENT  => 4;
 
 our %ERRORS = (
-    'OK' => OK,
+    'OK'        => OK,
     'WARNING'   => WARNING,
     'CRITICAL'  => CRITICAL,
     'UNKNOWN'   => UNKNOWN,
@@ -84,7 +84,8 @@
     $output = "$shortname $output" if $shortname;
     if ($arg->{plugin}) {
         my $plugin = $arg->{plugin};
-        $output .= " | ". $plugin->all_perfoutput if $plugin->perfdata;
+        $output .= " | ". $plugin->all_perfoutput 
+            if $plugin->perfdata && $plugin->all_perfoutput;
     }
     $output .= "\n";
 
@@ -193,7 +194,7 @@
     # Constants OK, WARNING, CRITICAL, and UNKNOWN exported by default
     use Nagios::Plugin::Functions;
 
-    # nagios_exit( ODE, $message ) - exit with error code CODE,
+    # nagios_exit( CODE, $message ) - exit with error code CODE,
     # and message "PLUGIN CODE - $message"
     nagios_exit( CRITICAL, $critical_error ) if $critical_error;
     nagios_exit( WARNING, $warning_error )   if $warning_error;
@@ -223,7 +224,7 @@
 functional interface, and who do not need the additional 
 functionality of Nagios::Plugin.
 
-=head2 Exports
+=head2 EXPORTS
 
 Nagios status code constants are exported by default:
 
@@ -245,13 +246,13 @@
     %STATUS_TEXT
 
 
-=head2 Functions
+=head2 FUNCTIONS
 
 The following functions are supported:
 
 =over 4
 
-=item nagios_exit( CODE, $message )
+=item nagios_exit( <CODE>, $message )
 
 Exit with return code CODE, and a standard nagios message of the
 form "PLUGIN CODE - $message".





More information about the Commits mailing list