diff options
author | Sven Nierlein <sven@nierlein.de> | 2014-01-20 14:49:14 +0100 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2014-01-20 14:49:14 +0100 |
commit | dfae38b656242898ce962c9ad93ed66be45fc3d4 (patch) | |
tree | d781a2ff90888c08379ebcd45f8ec51dda324882 | |
parent | b418181dfe80dd75169b6e8a619ac1932155dea2 (diff) | |
download | monitoring-plugin-perl-dfae38b656242898ce962c9ad93ed66be45fc3d4.tar.gz |
keep the old name in copyright for more transparencyv0.37
Signed-off-by: Sven Nierlein <sven@nierlein.de>
-rw-r--r-- | MANIFEST | 3 | ||||
-rw-r--r-- | META.yml | 53 | ||||
-rw-r--r-- | Makefile.PL | 14 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | lib/Monitoring/Plugin.pm | 5 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Config.pm | 10 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/ExitResult.pm | 9 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Functions.pm | 9 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Getopt.pm | 12 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Performance.pm | 4 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Range.pm | 4 | ||||
-rw-r--r-- | lib/Monitoring/Plugin/Threshold.pm | 4 | ||||
-rw-r--r-- | notes | 9 | ||||
-rwxr-xr-x | t/check_stuff.pl | 26 |
14 files changed, 98 insertions, 69 deletions
@@ -1,11 +1,8 @@ | |||
1 | Changes | 1 | Changes |
2 | inc/Module/AutoInstall.pm | ||
3 | inc/Module/Install.pm | 2 | inc/Module/Install.pm |
4 | inc/Module/Install/AutoInstall.pm | ||
5 | inc/Module/Install/Base.pm | 3 | inc/Module/Install/Base.pm |
6 | inc/Module/Install/Can.pm | 4 | inc/Module/Install/Can.pm |
7 | inc/Module/Install/Fetch.pm | 5 | inc/Module/Install/Fetch.pm |
8 | inc/Module/Install/Include.pm | ||
9 | inc/Module/Install/Makefile.pm | 6 | inc/Module/Install/Makefile.pm |
10 | inc/Module/Install/Metadata.pm | 7 | inc/Module/Install/Metadata.pm |
11 | inc/Module/Install/Win32.pm | 8 | inc/Module/Install/Win32.pm |
@@ -1,19 +1,36 @@ | |||
1 | # http://module-build.sourceforge.net/META-spec.html | 1 | --- |
2 | #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# | 2 | abstract: ~ |
3 | name: Nagios-Plugin | 3 | author: |
4 | version: 0.21 | 4 | - 'This code is maintained by the Monitoring Plugin Development Team: see' |
5 | version_from: lib/Nagios/Plugin/Functions.pm | 5 | - 'Monitoring Plugin Team <devel@monitoring-plugins.org>' |
6 | installdirs: site | 6 | build_requires: |
7 | requires: | 7 | ExtUtils::MakeMaker: 6.59 |
8 | Carp: 0 | 8 | Test::More: 0.62 |
9 | Class::Accessor: 0 | 9 | configure_requires: |
10 | Config::Tiny: 0 | 10 | ExtUtils::MakeMaker: 6.59 |
11 | File::Basename: 0 | ||
12 | File::Spec: 0 | ||
13 | IO::File: 0 | ||
14 | Math::Calc::Units: 0 | ||
15 | Params::Validate: 0 | ||
16 | Test::More: 0.62 | ||
17 | |||
18 | distribution_type: module | 11 | distribution_type: module |
19 | generated_by: ExtUtils::MakeMaker version 6.17 | 12 | dynamic_config: 1 |
13 | generated_by: 'Module::Install version 1.06' | ||
14 | license: perl | ||
15 | meta-spec: | ||
16 | url: http://module-build.sourceforge.net/META-spec-v1.4.html | ||
17 | version: 1.4 | ||
18 | name: Monitoring-Plugin | ||
19 | no_index: | ||
20 | directory: | ||
21 | - inc | ||
22 | - t | ||
23 | requires: | ||
24 | Carp: 0 | ||
25 | Class::Accessor: 0 | ||
26 | Config::Tiny: 0 | ||
27 | File::Basename: 0 | ||
28 | File::Spec: 0 | ||
29 | IO::File: 0 | ||
30 | Math::Calc::Units: 0 | ||
31 | Params::Validate: 0 | ||
32 | perl: 5.6.0 | ||
33 | resources: | ||
34 | license: http://dev.perl.org/licenses/ | ||
35 | repository: https://github.com/monitoring-plugins/monitoring-plugin-perl | ||
36 | version: 0.37 | ||
diff --git a/Makefile.PL b/Makefile.PL index d1f0c2a..2fa285d 100644 --- a/Makefile.PL +++ b/Makefile.PL | |||
@@ -1,10 +1,10 @@ | |||
1 | use inc::Module::Install; | 1 | use inc::Module::Install; |
2 | 2 | ||
3 | name 'Monitoring-Plugin'; | 3 | name 'Monitoring-Plugin'; |
4 | all_from 'lib/Monitoring/Plugin/Functions.pm'; | 4 | all_from 'lib/Monitoring/Plugin/Functions.pm'; |
5 | author q{Monitoring Plugin Team <devel@monitoring-plugins.org>}; | 5 | author 'Monitoring Plugin Team <devel@monitoring-plugins.org>'; |
6 | license 'perl'; | 6 | license 'perl'; |
7 | repository 'https://github.com/monitoring-plugins/monitoring-plugin-perl'; | 7 | repository 'https://github.com/monitoring-plugins/monitoring-plugin-perl'; |
8 | 8 | ||
9 | requires 'Params::Validate' => 0; | 9 | requires 'Params::Validate' => 0; |
10 | requires 'Class::Accessor' => 0; | 10 | requires 'Class::Accessor' => 0; |
@@ -13,11 +13,9 @@ requires 'Config::Tiny' => 0; | |||
13 | requires 'File::Spec' => 0; | 13 | requires 'File::Spec' => 0; |
14 | requires 'File::Basename' => 0; | 14 | requires 'File::Basename' => 0; |
15 | requires 'IO::File' => 0; | 15 | requires 'IO::File' => 0; |
16 | requires 'Math::Calc::Units' => 0; # used in M::P::Performance | 16 | requires 'Math::Calc::Units' => 0; # used in M::P::Performance |
17 | 17 | ||
18 | 18 | ||
19 | build_requires 'Test::More' => 0.62; | 19 | build_requires 'Test::More' => 0.62; |
20 | 20 | ||
21 | auto_install; | ||
22 | |||
23 | WriteAll; | 21 | WriteAll; |
@@ -6,7 +6,7 @@ Icinga, Shinken and other compatible products. It is meant to | |||
6 | simplify a lot of the common functions required to do checking of a | 6 | simplify a lot of the common functions required to do checking of a |
7 | particular service. | 7 | particular service. |
8 | This module is maintained by the Monitoring-Plugins team | 8 | This module is maintained by the Monitoring-Plugins team |
9 | (https:://monitoring-plugins.org) | 9 | (https://monitoring-plugins.org) |
10 | 10 | ||
11 | INSTALLATION | 11 | INSTALLATION |
12 | 12 | ||
@@ -28,7 +28,8 @@ working example of a plugin script. | |||
28 | 28 | ||
29 | COPYRIGHT AND LICENCE | 29 | COPYRIGHT AND LICENCE |
30 | 30 | ||
31 | Copyright (C) 2006-2014 by Monitoring Plugin Team | 31 | Copyright (C) 2014 by Monitoring Plugin Team |
32 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
32 | 33 | ||
33 | This library is free software; you can redistribute it and/or modify | 34 | This library is free software; you can redistribute it and/or modify |
34 | it under the same terms as Perl itself, either Perl version 5.8.4 or, | 35 | it under the same terms as Perl itself, either Perl version 5.8.4 or, |
diff --git a/lib/Monitoring/Plugin.pm b/lib/Monitoring/Plugin.pm index f9eb49e..a5b51b1 100644 --- a/lib/Monitoring/Plugin.pm +++ b/lib/Monitoring/Plugin.pm | |||
@@ -1,9 +1,9 @@ | |||
1 | |||
2 | package Monitoring::Plugin; | 1 | package Monitoring::Plugin; |
3 | 2 | ||
4 | use Monitoring::Plugin::Functions qw(:codes %ERRORS %STATUS_TEXT @STATUS_CODES); | 3 | use Monitoring::Plugin::Functions qw(:codes %ERRORS %STATUS_TEXT @STATUS_CODES); |
5 | use Params::Validate qw(:all); | 4 | use Params::Validate qw(:all); |
6 | 5 | ||
6 | use 5.006; | ||
7 | use strict; | 7 | use strict; |
8 | use warnings; | 8 | use warnings; |
9 | 9 | ||
@@ -703,7 +703,8 @@ Originally by Ton Voon, E<lt>ton.voon@altinity.comE<gt>. | |||
703 | 703 | ||
704 | =head1 COPYRIGHT AND LICENSE | 704 | =head1 COPYRIGHT AND LICENSE |
705 | 705 | ||
706 | Copyright (C) 2006-2014 by Monitoring Plugin Team | 706 | Copyright (C) 2014 by Monitoring Plugin Team |
707 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
707 | 708 | ||
708 | This library is free software; you can redistribute it and/or modify it | 709 | This library is free software; you can redistribute it and/or modify it |
709 | under the same terms as Perl itself, either Perl version 5.8.4 or, at your | 710 | under the same terms as Perl itself, either Perl version 5.8.4 or, at your |
diff --git a/lib/Monitoring/Plugin/Config.pm b/lib/Monitoring/Plugin/Config.pm index 5e941d4..fe2b654 100644 --- a/lib/Monitoring/Plugin/Config.pm +++ b/lib/Monitoring/Plugin/Config.pm | |||
@@ -1,6 +1,9 @@ | |||
1 | package Monitoring::Plugin::Config; | 1 | package Monitoring::Plugin::Config; |
2 | 2 | ||
3 | use 5.006; | ||
3 | use strict; | 4 | use strict; |
5 | use warnings; | ||
6 | |||
4 | use Carp; | 7 | use Carp; |
5 | use File::Spec; | 8 | use File::Spec; |
6 | use base qw(Config::Tiny); | 9 | use base qw(Config::Tiny); |
@@ -93,10 +96,12 @@ sub read_string | |||
93 | sub write { croak "Write access not permitted" } | 96 | sub write { croak "Write access not permitted" } |
94 | 97 | ||
95 | # Return last file used by read(); | 98 | # Return last file used by read(); |
96 | sub np_getfile { return $CURRENT_FILE; } | 99 | sub mp_getfile { return $CURRENT_FILE; } |
97 | 100 | ||
98 | 1; | 101 | 1; |
99 | 102 | ||
103 | __END__ | ||
104 | |||
100 | =head1 NAME | 105 | =head1 NAME |
101 | 106 | ||
102 | Monitoring::Plugin::Config - read nagios plugin .ini style config files | 107 | Monitoring::Plugin::Config - read nagios plugin .ini style config files |
@@ -169,7 +174,8 @@ https://monitoring-plugins.org | |||
169 | 174 | ||
170 | =head1 COPYRIGHT AND LICENSE | 175 | =head1 COPYRIGHT AND LICENSE |
171 | 176 | ||
172 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 177 | Copyright (C) 2014 by Monitoring Plugin Team |
178 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
173 | 179 | ||
174 | This library is free software; you can redistribute it and/or modify | 180 | This library is free software; you can redistribute it and/or modify |
175 | it under the same terms as Perl itself. | 181 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/ExitResult.pm b/lib/Monitoring/Plugin/ExitResult.pm index aa9f5da..ab79a19 100644 --- a/lib/Monitoring/Plugin/ExitResult.pm +++ b/lib/Monitoring/Plugin/ExitResult.pm | |||
@@ -1,8 +1,10 @@ | |||
1 | # Tiny helper class to return both output and return_code when testing | ||
2 | |||
3 | package Monitoring::Plugin::ExitResult; | 1 | package Monitoring::Plugin::ExitResult; |
4 | 2 | ||
3 | # Tiny helper class to return both output and return_code when testing | ||
4 | |||
5 | use 5.006; | ||
5 | use strict; | 6 | use strict; |
7 | use warnings; | ||
6 | 8 | ||
7 | # Stringify to message | 9 | # Stringify to message |
8 | use overload '""' => sub { shift->{message} }; | 10 | use overload '""' => sub { shift->{message} }; |
@@ -63,7 +65,8 @@ Originally: | |||
63 | 65 | ||
64 | =head1 COPYRIGHT AND LICENSE | 66 | =head1 COPYRIGHT AND LICENSE |
65 | 67 | ||
66 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 68 | Copyright (C) 2014 by Monitoring Plugin Team |
69 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
67 | 70 | ||
68 | This library is free software; you can redistribute it and/or modify | 71 | This library is free software; you can redistribute it and/or modify |
69 | it under the same terms as Perl itself. | 72 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/Functions.pm b/lib/Monitoring/Plugin/Functions.pm index d2856e8..d362f9c 100644 --- a/lib/Monitoring/Plugin/Functions.pm +++ b/lib/Monitoring/Plugin/Functions.pm | |||
@@ -1,12 +1,12 @@ | |||
1 | package Monitoring::Plugin::Functions; | ||
2 | |||
1 | # Functional interface to basic Monitoring::Plugin constants, exports, | 3 | # Functional interface to basic Monitoring::Plugin constants, exports, |
2 | # and functions | 4 | # and functions |
3 | 5 | ||
4 | package Monitoring::Plugin::Functions; | ||
5 | |||
6 | use 5.006; | 6 | use 5.006; |
7 | |||
8 | use strict; | 7 | use strict; |
9 | use warnings; | 8 | use warnings; |
9 | |||
10 | use File::Basename; | 10 | use File::Basename; |
11 | use Params::Validate qw(:types validate); | 11 | use Params::Validate qw(:types validate); |
12 | use Math::Calc::Units; | 12 | use Math::Calc::Units; |
@@ -437,7 +437,8 @@ https://monitoring-plugins.org | |||
437 | 437 | ||
438 | =head1 COPYRIGHT AND LICENSE | 438 | =head1 COPYRIGHT AND LICENSE |
439 | 439 | ||
440 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 440 | Copyright (C) 2014 by Monitoring Plugin Team |
441 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
441 | 442 | ||
442 | This library is free software; you can redistribute it and/or modify | 443 | This library is free software; you can redistribute it and/or modify |
443 | it under the same terms as Perl itself. | 444 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm index ce1c0f9..ebdd559 100644 --- a/lib/Monitoring/Plugin/Getopt.pm +++ b/lib/Monitoring/Plugin/Getopt.pm | |||
@@ -1,11 +1,14 @@ | |||
1 | package Monitoring::Plugin::Getopt; | ||
2 | |||
1 | # | 3 | # |
2 | # Monitoring::Plugin::Getopt - OO perl module providing standardised argument | 4 | # Monitoring::Plugin::Getopt - OO perl module providing standardised argument |
3 | # processing for nagios plugins | 5 | # processing for nagios plugins |
4 | # | 6 | # |
5 | 7 | ||
6 | package Monitoring::Plugin::Getopt; | 8 | use 5.006; |
7 | |||
8 | use strict; | 9 | use strict; |
10 | use warnings; | ||
11 | |||
9 | use File::Basename; | 12 | use File::Basename; |
10 | use Getopt::Long qw(:config no_ignore_case bundling); | 13 | use Getopt::Long qw(:config no_ignore_case bundling); |
11 | use Carp; | 14 | use Carp; |
@@ -249,7 +252,7 @@ sub _load_config_section | |||
249 | # TODO: is this check sane? Does --extra-opts=foo require a [foo] section? | 252 | # TODO: is this check sane? Does --extra-opts=foo require a [foo] section? |
250 | ## Nevertheless, if we die as UNKNOWN here we should do the same on default | 253 | ## Nevertheless, if we die as UNKNOWN here we should do the same on default |
251 | ## file *added eval/_die above*. | 254 | ## file *added eval/_die above*. |
252 | $file ||= $Config->np_getfile(); | 255 | $file ||= $Config->mp_getfile(); |
253 | $self->_die("Invalid section '$section' in config file '$file'") | 256 | $self->_die("Invalid section '$section' in config file '$file'") |
254 | unless exists $Config->{$section}; | 257 | unless exists $Config->{$section}; |
255 | 258 | ||
@@ -861,7 +864,8 @@ Originally: | |||
861 | 864 | ||
862 | =head1 COPYRIGHT AND LICENSE | 865 | =head1 COPYRIGHT AND LICENSE |
863 | 866 | ||
864 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 867 | Copyright (C) 2014 by Monitoring Plugin Team |
868 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
865 | 869 | ||
866 | This library is free software; you can redistribute it and/or modify | 870 | This library is free software; you can redistribute it and/or modify |
867 | it under the same terms as Perl itself. | 871 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/Performance.pm b/lib/Monitoring/Plugin/Performance.pm index 90fc9f4..f1e7a16 100644 --- a/lib/Monitoring/Plugin/Performance.pm +++ b/lib/Monitoring/Plugin/Performance.pm | |||
@@ -1,7 +1,6 @@ | |||
1 | package Monitoring::Plugin::Performance; | 1 | package Monitoring::Plugin::Performance; |
2 | 2 | ||
3 | use 5.006; | 3 | use 5.006; |
4 | |||
5 | use strict; | 4 | use strict; |
6 | use warnings; | 5 | use warnings; |
7 | 6 | ||
@@ -286,7 +285,8 @@ https://monitoring-plugins.org | |||
286 | 285 | ||
287 | =head1 COPYRIGHT AND LICENSE | 286 | =head1 COPYRIGHT AND LICENSE |
288 | 287 | ||
289 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 288 | Copyright (C) 2014 by Monitoring Plugin Team |
289 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
290 | 290 | ||
291 | This library is free software; you can redistribute it and/or modify | 291 | This library is free software; you can redistribute it and/or modify |
292 | it under the same terms as Perl itself. | 292 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/Range.pm b/lib/Monitoring/Plugin/Range.pm index af19577..4cacfd4 100644 --- a/lib/Monitoring/Plugin/Range.pm +++ b/lib/Monitoring/Plugin/Range.pm | |||
@@ -1,7 +1,6 @@ | |||
1 | package Monitoring::Plugin::Range; | 1 | package Monitoring::Plugin::Range; |
2 | 2 | ||
3 | use 5.006; | 3 | use 5.006; |
4 | |||
5 | use strict; | 4 | use strict; |
6 | use warnings; | 5 | use warnings; |
7 | 6 | ||
@@ -161,7 +160,8 @@ https://monitoring-plugins.org | |||
161 | 160 | ||
162 | =head1 COPYRIGHT AND LICENSE | 161 | =head1 COPYRIGHT AND LICENSE |
163 | 162 | ||
164 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 163 | Copyright (C) 2014 by Monitoring Plugin Team |
164 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
165 | 165 | ||
166 | This library is free software; you can redistribute it and/or modify | 166 | This library is free software; you can redistribute it and/or modify |
167 | it under the same terms as Perl itself. | 167 | it under the same terms as Perl itself. |
diff --git a/lib/Monitoring/Plugin/Threshold.pm b/lib/Monitoring/Plugin/Threshold.pm index e71e21b..06dbf0c 100644 --- a/lib/Monitoring/Plugin/Threshold.pm +++ b/lib/Monitoring/Plugin/Threshold.pm | |||
@@ -1,7 +1,6 @@ | |||
1 | package Monitoring::Plugin::Threshold; | 1 | package Monitoring::Plugin::Threshold; |
2 | 2 | ||
3 | use 5.006; | 3 | use 5.006; |
4 | |||
5 | use strict; | 4 | use strict; |
6 | use warnings; | 5 | use warnings; |
7 | 6 | ||
@@ -126,7 +125,8 @@ https://monitoring-plugins.org | |||
126 | 125 | ||
127 | =head1 COPYRIGHT AND LICENSE | 126 | =head1 COPYRIGHT AND LICENSE |
128 | 127 | ||
129 | Copyright (C) 2006-2014 Monitoring Plugin Development Team | 128 | Copyright (C) 2014 by Monitoring Plugin Team |
129 | Copyright (C) 2006-2014 by Nagios Plugin Development Team | ||
130 | 130 | ||
131 | This library is free software; you can redistribute it and/or modify | 131 | This library is free software; you can redistribute it and/or modify |
132 | it under the same terms as Perl itself. | 132 | it under the same terms as Perl itself. |
@@ -1,8 +1,8 @@ | |||
1 | RELEASING | 1 | RELEASING |
2 | 2 | ||
3 | Change version number in lib/Nagios/Plugin.pm and lib/Nagios/Plugin/Functions.pm | 3 | Change version number in lib/Monitoring/Plugin.pm and lib/Monitoring/Plugin/Functions.pm |
4 | Add date to Changes file | 4 | Add date to Changes file |
5 | svn commit | 5 | git commit |
6 | 6 | ||
7 | perl Makefile.PL | 7 | perl Makefile.PL |
8 | make | 8 | make |
@@ -11,5 +11,6 @@ make dist | |||
11 | 11 | ||
12 | Upload file to CPAN | 12 | Upload file to CPAN |
13 | 13 | ||
14 | Send announcement to nagiosplug-help, nagios-announce | 14 | Send announcement to announce@monitoring-plugins.org, help@monitoring-plugins.org and |
15 | Add news item to http://nagiosplugins.org | 15 | devel@monitoring-plugins.org |
16 | Add news item to https://monitoring-plugins.org | ||
diff --git a/t/check_stuff.pl b/t/check_stuff.pl index 4fc125c..dca4e58 100755 --- a/t/check_stuff.pl +++ b/t/check_stuff.pl | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | ### check_stuff.pl | 3 | ### check_stuff.pl |
4 | 4 | ||
5 | # an example Monitoring plugin using the Monitoring::Plugin modules. | 5 | # an example plugin using the Monitoring::Plugin module. |
6 | 6 | ||
7 | # Originally by Nathan Vonnahme, n8v at users dot sourceforge | 7 | # Originally by Nathan Vonnahme, n8v at users dot sourceforge |
8 | # dot net, July 19 2006 | 8 | # dot net, July 19 2006 |
@@ -41,7 +41,7 @@ my $p = Monitoring::Plugin->new( | |||
41 | version => $VERSION, | 41 | version => $VERSION, |
42 | blurb => 'This plugin is an example of a monitoring plugin written in Perl using the Monitoring::Plugin modules. It will generate a random integer between 1 and 20 (though you can specify the number with the -n option for testing), and will output OK, WARNING or CRITICAL if the resulting number is outside the specified thresholds.', | 42 | blurb => 'This plugin is an example of a monitoring plugin written in Perl using the Monitoring::Plugin modules. It will generate a random integer between 1 and 20 (though you can specify the number with the -n option for testing), and will output OK, WARNING or CRITICAL if the resulting number is outside the specified thresholds.', |
43 | 43 | ||
44 | extra => " | 44 | extra => " |
45 | 45 | ||
46 | THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' | 46 | THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' |
47 | (or 'max'). If specified '\@min:max', a warning status will be generated | 47 | (or 'max'). If specified '\@min:max', a warning status will be generated |
@@ -69,28 +69,28 @@ See more threshold examples at https://www.monitoring-plugins.org/doc/guidelines | |||
69 | # usage, help, version, timeout and verbose are defined by default. | 69 | # usage, help, version, timeout and verbose are defined by default. |
70 | 70 | ||
71 | $p->add_arg( | 71 | $p->add_arg( |
72 | spec => 'warning|w=s', | 72 | spec => 'warning|w=s', |
73 | 73 | ||
74 | help => | 74 | help => |
75 | qq{-w, --warning=INTEGER:INTEGER | 75 | qq{-w, --warning=INTEGER:INTEGER |
76 | Minimum and maximum number of allowable result, outside of which a | 76 | Minimum and maximum number of allowable result, outside of which a |
77 | warning will be generated. If omitted, no warning is generated.}, | 77 | warning will be generated. If omitted, no warning is generated.}, |
78 | 78 | ||
79 | # required => 1, | 79 | # required => 1, |
80 | # default => 10, | 80 | # default => 10, |
81 | ); | 81 | ); |
82 | 82 | ||
83 | $p->add_arg( | 83 | $p->add_arg( |
84 | spec => 'critical|c=s', | 84 | spec => 'critical|c=s', |
85 | help => | 85 | help => |
86 | qq{-c, --critical=INTEGER:INTEGER | 86 | qq{-c, --critical=INTEGER:INTEGER |
87 | Minimum and maximum number of the generated result, outside of | 87 | Minimum and maximum number of the generated result, outside of |
88 | which a critical will be generated. }, | 88 | which a critical will be generated. }, |
89 | ); | 89 | ); |
90 | 90 | ||
91 | $p->add_arg( | 91 | $p->add_arg( |
92 | spec => 'result|r=f', | 92 | spec => 'result|r=f', |
93 | help => | 93 | help => |
94 | qq{-r, --result=INTEGER | 94 | qq{-r, --result=INTEGER |
95 | Specify the result on the command line rather than generating a | 95 | Specify the result on the command line rather than generating a |
96 | random number. For testing.}, | 96 | random number. For testing.}, |
@@ -106,7 +106,7 @@ if ( (defined $p->opts->result) && ($p->opts->result < 0 || $p->opts->result > 2 | |||
106 | } | 106 | } |
107 | 107 | ||
108 | unless ( defined $p->opts->warning || defined $p->opts->critical ) { | 108 | unless ( defined $p->opts->warning || defined $p->opts->critical ) { |
109 | $p->plugin_die( " you didn't supply a threshold argument " ); | 109 | $p->plugin_die( " you didn't supply a threshold argument " ); |
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
@@ -132,6 +132,6 @@ else { | |||
132 | # check the result against the defined warning and critical thresholds, | 132 | # check the result against the defined warning and critical thresholds, |
133 | # output the result and exit | 133 | # output the result and exit |
134 | $p->plugin_exit( | 134 | $p->plugin_exit( |
135 | return_code => $p->check_threshold($result), | 135 | return_code => $p->check_threshold($result), |
136 | message => " sample result was $result" | 136 | message => " sample result was $result" |
137 | ); | 137 | ); |