From bc239b3bd5023ed2da77ab03c581e56a4772f1d4 Mon Sep 17 00:00:00 2001 From: Nathan Vonnahme Date: Thu, 7 Sep 2006 00:53:51 +0000 Subject: adding example script and test for it, and fixing POD according to warnings from POD::Checker git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1476 f882894a-f735-0410-b71e-b25c423dba1c --- lib/Nagios/Plugin.pm | 26 ++++++++++++++++++++++---- lib/Nagios/Plugin/Getopt.pm | 4 +--- lib/Nagios/Plugin/Performance.pm | 4 ++++ lib/Nagios/Plugin/Threshold.pm | 2 ++ 4 files changed, 29 insertions(+), 7 deletions(-) (limited to 'lib/Nagios') diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm index c14dfa6..0915571 100644 --- a/lib/Nagios/Plugin.pm +++ b/lib/Nagios/Plugin.pm @@ -86,6 +86,12 @@ This is the place for common routines when writing Nagios plugins. The idea is t easy as possible for developers to conform to the plugin guidelines (http://nagiosplug.sourceforge.net/developer-guidelines.html). +=head1 EXAMPLE SCRIPT + +"Enough talk! Show me where to start!" + +See the file 'check_stuff.pl' in the 't' directory for a complete working example of a plugin script. + =head1 DESIGN To facilitate object oriented classes, there are multiple perl modules, each reflecting a type of data @@ -105,22 +111,30 @@ Only methods listed in the documentation for each module is public. These modules are experimental and so the interfaces may change up until Nagios::Plugin hits version 1.0, but every attempt will be made to make backwards compatible. -=over 4 - =head1 STARTING +=over 4 + =item use Nagios::Plugin qw(%ERRORS) Imports the %ERRORS hash. This is currently the only symbol that can be imported. +=back + =head1 CLASS METHODS +=over 4 + =item Nagios::Plugin->new( shortname => $$ ) Initializes a new Nagios::Plugin object. Can specify the shortname here. +=back + =head1 OBJECT METHODS +=over 4 + =item set_thresholds( warning => "10:25", critical => "~:25" ) Sets the thresholds, based on the range specification at @@ -147,9 +161,13 @@ http://nagiosplug.sourceforge.net =head1 AUTHOR -Ton Voon, Eton.voon@altinity.comE +Maintained by the Nagios Plugin development team - http://nagiosplug.sourceforge.net + +Originally by Ton Voon, Eton.voon@altinity.comE + +Nathan Vonnahme added extra tests and subsequent fixes. -Thanks to Nathan Vonnahme for loads of extra tests and subsequent fixes. +Gavin Carr contributed the Nagios::Plugin::GetOpt module. =head1 COPYRIGHT AND LICENSE diff --git a/lib/Nagios/Plugin/Getopt.pm b/lib/Nagios/Plugin/Getopt.pm index 1903e8c..d38dced 100644 --- a/lib/Nagios/Plugin/Getopt.pm +++ b/lib/Nagios/Plugin/Getopt.pm @@ -296,9 +296,7 @@ __END__ =head1 NAME -Nagios::Plugin::Getopt - OO perl module providing standardised argument -processing for Nagios plugins - +Nagios::Plugin::Getopt - OO perl module providing standardised argument processing for Nagios plugins =head1 VERSION diff --git a/lib/Nagios/Plugin/Performance.pm b/lib/Nagios/Plugin/Performance.pm index 83c92fb..9e99f54 100644 --- a/lib/Nagios/Plugin/Performance.pm +++ b/lib/Nagios/Plugin/Performance.pm @@ -106,8 +106,12 @@ Once the performance string has been parsed, you can query the label, value, uom Returns an array of Nagios::Plugin::Performance objects based on the string entered. If there is an error parsing the string, an empty array is returned. +=back + =head1 OBJECT METHODS +=over 4 + =item label, value, uom, min, max These all return scalars. min and max are not well supported yet. diff --git a/lib/Nagios/Plugin/Threshold.pm b/lib/Nagios/Plugin/Threshold.pm index f3410e8..9e7b938 100644 --- a/lib/Nagios/Plugin/Threshold.pm +++ b/lib/Nagios/Plugin/Threshold.pm @@ -83,6 +83,8 @@ Returns the warning or critical range as a Nagios::Plugin::Range object. Given a value, will see if the value breeches the critical or the warning range. Returns the status code. +=back + =head1 AUTHOR Ton Voon, Eton.voon@altinity.comE -- cgit v1.2.3-74-g34f1