diff options
Diffstat (limited to 'lib/Nagios')
| -rw-r--r-- | lib/Nagios/Plugin.pm | 26 | ||||
| -rw-r--r-- | lib/Nagios/Plugin/Getopt.pm | 4 | ||||
| -rw-r--r-- | lib/Nagios/Plugin/Performance.pm | 4 | ||||
| -rw-r--r-- | lib/Nagios/Plugin/Threshold.pm | 2 |
4 files changed, 29 insertions, 7 deletions
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 | |||
| 86 | easy as possible for developers to conform to the plugin guidelines | 86 | easy as possible for developers to conform to the plugin guidelines |
| 87 | (http://nagiosplug.sourceforge.net/developer-guidelines.html). | 87 | (http://nagiosplug.sourceforge.net/developer-guidelines.html). |
| 88 | 88 | ||
| 89 | =head1 EXAMPLE SCRIPT | ||
| 90 | |||
| 91 | "Enough talk! Show me where to start!" | ||
| 92 | |||
| 93 | See the file 'check_stuff.pl' in the 't' directory for a complete working example of a plugin script. | ||
| 94 | |||
| 89 | =head1 DESIGN | 95 | =head1 DESIGN |
| 90 | 96 | ||
| 91 | To facilitate object oriented classes, there are multiple perl modules, each reflecting a type of data | 97 | 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. | |||
| 105 | These modules are experimental and so the interfaces may change up until Nagios::Plugin | 111 | These modules are experimental and so the interfaces may change up until Nagios::Plugin |
| 106 | hits version 1.0, but every attempt will be made to make backwards compatible. | 112 | hits version 1.0, but every attempt will be made to make backwards compatible. |
| 107 | 113 | ||
| 108 | =over 4 | ||
| 109 | |||
| 110 | =head1 STARTING | 114 | =head1 STARTING |
| 111 | 115 | ||
| 116 | =over 4 | ||
| 117 | |||
| 112 | =item use Nagios::Plugin qw(%ERRORS) | 118 | =item use Nagios::Plugin qw(%ERRORS) |
| 113 | 119 | ||
| 114 | Imports the %ERRORS hash. This is currently the only symbol that can be imported. | 120 | Imports the %ERRORS hash. This is currently the only symbol that can be imported. |
| 115 | 121 | ||
| 122 | =back | ||
| 123 | |||
| 116 | =head1 CLASS METHODS | 124 | =head1 CLASS METHODS |
| 117 | 125 | ||
| 126 | =over 4 | ||
| 127 | |||
| 118 | =item Nagios::Plugin->new( shortname => $$ ) | 128 | =item Nagios::Plugin->new( shortname => $$ ) |
| 119 | 129 | ||
| 120 | Initializes a new Nagios::Plugin object. Can specify the shortname here. | 130 | Initializes a new Nagios::Plugin object. Can specify the shortname here. |
| 121 | 131 | ||
| 132 | =back | ||
| 133 | |||
| 122 | =head1 OBJECT METHODS | 134 | =head1 OBJECT METHODS |
| 123 | 135 | ||
| 136 | =over 4 | ||
| 137 | |||
| 124 | =item set_thresholds( warning => "10:25", critical => "~:25" ) | 138 | =item set_thresholds( warning => "10:25", critical => "~:25" ) |
| 125 | 139 | ||
| 126 | Sets the thresholds, based on the range specification at | 140 | Sets the thresholds, based on the range specification at |
| @@ -147,9 +161,13 @@ http://nagiosplug.sourceforge.net | |||
| 147 | 161 | ||
| 148 | =head1 AUTHOR | 162 | =head1 AUTHOR |
| 149 | 163 | ||
| 150 | Ton Voon, E<lt>ton.voon@altinity.comE<gt> | 164 | Maintained by the Nagios Plugin development team - http://nagiosplug.sourceforge.net |
| 165 | |||
| 166 | Originally by Ton Voon, E<lt>ton.voon@altinity.comE<gt> | ||
| 167 | |||
| 168 | Nathan Vonnahme added extra tests and subsequent fixes. | ||
| 151 | 169 | ||
| 152 | Thanks to Nathan Vonnahme for loads of extra tests and subsequent fixes. | 170 | Gavin Carr contributed the Nagios::Plugin::GetOpt module. |
| 153 | 171 | ||
| 154 | =head1 COPYRIGHT AND LICENSE | 172 | =head1 COPYRIGHT AND LICENSE |
| 155 | 173 | ||
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__ | |||
| 296 | 296 | ||
| 297 | =head1 NAME | 297 | =head1 NAME |
| 298 | 298 | ||
| 299 | Nagios::Plugin::Getopt - OO perl module providing standardised argument | 299 | Nagios::Plugin::Getopt - OO perl module providing standardised argument processing for Nagios plugins |
| 300 | processing for Nagios plugins | ||
| 301 | |||
| 302 | 300 | ||
| 303 | =head1 VERSION | 301 | =head1 VERSION |
| 304 | 302 | ||
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 | |||
| 106 | Returns an array of Nagios::Plugin::Performance objects based on the string entered. | 106 | Returns an array of Nagios::Plugin::Performance objects based on the string entered. |
| 107 | If there is an error parsing the string, an empty array is returned. | 107 | If there is an error parsing the string, an empty array is returned. |
| 108 | 108 | ||
| 109 | =back | ||
| 110 | |||
| 109 | =head1 OBJECT METHODS | 111 | =head1 OBJECT METHODS |
| 110 | 112 | ||
| 113 | =over 4 | ||
| 114 | |||
| 111 | =item label, value, uom, min, max | 115 | =item label, value, uom, min, max |
| 112 | 116 | ||
| 113 | These all return scalars. min and max are not well supported yet. | 117 | 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. | |||
| 83 | 83 | ||
| 84 | Given a value, will see if the value breeches the critical or the warning range. Returns the status code. | 84 | Given a value, will see if the value breeches the critical or the warning range. Returns the status code. |
| 85 | 85 | ||
| 86 | =back | ||
| 87 | |||
| 86 | =head1 AUTHOR | 88 | =head1 AUTHOR |
| 87 | 89 | ||
| 88 | Ton Voon, E<lt>ton.voon@altinity.comE<gt> | 90 | Ton Voon, E<lt>ton.voon@altinity.comE<gt> |
