summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2014-01-20 14:49:14 +0100
committerSven Nierlein <sven@nierlein.de>2014-01-20 14:49:14 +0100
commitdfae38b656242898ce962c9ad93ed66be45fc3d4 (patch)
treed781a2ff90888c08379ebcd45f8ec51dda324882
parentb418181dfe80dd75169b6e8a619ac1932155dea2 (diff)
downloadmonitoring-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--MANIFEST3
-rw-r--r--META.yml53
-rw-r--r--Makefile.PL14
-rw-r--r--README5
-rw-r--r--lib/Monitoring/Plugin.pm5
-rw-r--r--lib/Monitoring/Plugin/Config.pm10
-rw-r--r--lib/Monitoring/Plugin/ExitResult.pm9
-rw-r--r--lib/Monitoring/Plugin/Functions.pm9
-rw-r--r--lib/Monitoring/Plugin/Getopt.pm12
-rw-r--r--lib/Monitoring/Plugin/Performance.pm4
-rw-r--r--lib/Monitoring/Plugin/Range.pm4
-rw-r--r--lib/Monitoring/Plugin/Threshold.pm4
-rw-r--r--notes9
-rwxr-xr-xt/check_stuff.pl26
14 files changed, 98 insertions, 69 deletions
diff --git a/MANIFEST b/MANIFEST
index 8ccb51c..3a48778 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,11 +1,8 @@
1Changes 1Changes
2inc/Module/AutoInstall.pm
3inc/Module/Install.pm 2inc/Module/Install.pm
4inc/Module/Install/AutoInstall.pm
5inc/Module/Install/Base.pm 3inc/Module/Install/Base.pm
6inc/Module/Install/Can.pm 4inc/Module/Install/Can.pm
7inc/Module/Install/Fetch.pm 5inc/Module/Install/Fetch.pm
8inc/Module/Install/Include.pm
9inc/Module/Install/Makefile.pm 6inc/Module/Install/Makefile.pm
10inc/Module/Install/Metadata.pm 7inc/Module/Install/Metadata.pm
11inc/Module/Install/Win32.pm 8inc/Module/Install/Win32.pm
diff --git a/META.yml b/META.yml
index 0a71585..ebeebb1 100644
--- a/META.yml
+++ b/META.yml
@@ -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# 2abstract: ~
3name: Nagios-Plugin 3author:
4version: 0.21 4 - 'This code is maintained by the Monitoring Plugin Development Team: see'
5version_from: lib/Nagios/Plugin/Functions.pm 5 - 'Monitoring Plugin Team <devel@monitoring-plugins.org>'
6installdirs: site 6build_requires:
7requires: 7 ExtUtils::MakeMaker: 6.59
8 Carp: 0 8 Test::More: 0.62
9 Class::Accessor: 0 9configure_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
18distribution_type: module 11distribution_type: module
19generated_by: ExtUtils::MakeMaker version 6.17 12dynamic_config: 1
13generated_by: 'Module::Install version 1.06'
14license: perl
15meta-spec:
16 url: http://module-build.sourceforge.net/META-spec-v1.4.html
17 version: 1.4
18name: Monitoring-Plugin
19no_index:
20 directory:
21 - inc
22 - t
23requires:
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
33resources:
34 license: http://dev.perl.org/licenses/
35 repository: https://github.com/monitoring-plugins/monitoring-plugin-perl
36version: 0.37
diff --git a/Makefile.PL b/Makefile.PL
index d1f0c2a..2fa285d 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,10 +1,10 @@
1use inc::Module::Install; 1use inc::Module::Install;
2 2
3name 'Monitoring-Plugin'; 3name 'Monitoring-Plugin';
4all_from 'lib/Monitoring/Plugin/Functions.pm'; 4all_from 'lib/Monitoring/Plugin/Functions.pm';
5author q{Monitoring Plugin Team <devel@monitoring-plugins.org>}; 5author 'Monitoring Plugin Team <devel@monitoring-plugins.org>';
6license 'perl'; 6license 'perl';
7repository 'https://github.com/monitoring-plugins/monitoring-plugin-perl'; 7repository 'https://github.com/monitoring-plugins/monitoring-plugin-perl';
8 8
9requires 'Params::Validate' => 0; 9requires 'Params::Validate' => 0;
10requires 'Class::Accessor' => 0; 10requires 'Class::Accessor' => 0;
@@ -13,11 +13,9 @@ requires 'Config::Tiny' => 0;
13requires 'File::Spec' => 0; 13requires 'File::Spec' => 0;
14requires 'File::Basename' => 0; 14requires 'File::Basename' => 0;
15requires 'IO::File' => 0; 15requires 'IO::File' => 0;
16requires 'Math::Calc::Units' => 0; # used in M::P::Performance 16requires 'Math::Calc::Units' => 0; # used in M::P::Performance
17 17
18 18
19build_requires 'Test::More' => 0.62; 19build_requires 'Test::More' => 0.62;
20 20
21auto_install;
22
23WriteAll; 21WriteAll;
diff --git a/README b/README
index b0550d6..476d39f 100644
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ Icinga, Shinken and other compatible products. It is meant to
6simplify a lot of the common functions required to do checking of a 6simplify a lot of the common functions required to do checking of a
7particular service. 7particular service.
8This module is maintained by the Monitoring-Plugins team 8This module is maintained by the Monitoring-Plugins team
9(https:://monitoring-plugins.org) 9(https://monitoring-plugins.org)
10 10
11INSTALLATION 11INSTALLATION
12 12
@@ -28,7 +28,8 @@ working example of a plugin script.
28 28
29COPYRIGHT AND LICENCE 29COPYRIGHT AND LICENCE
30 30
31Copyright (C) 2006-2014 by Monitoring Plugin Team 31Copyright (C) 2014 by Monitoring Plugin Team
32Copyright (C) 2006-2014 by Nagios Plugin Development Team
32 33
33This library is free software; you can redistribute it and/or modify 34This library is free software; you can redistribute it and/or modify
34it under the same terms as Perl itself, either Perl version 5.8.4 or, 35it 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
2package Monitoring::Plugin; 1package Monitoring::Plugin;
3 2
4use Monitoring::Plugin::Functions qw(:codes %ERRORS %STATUS_TEXT @STATUS_CODES); 3use Monitoring::Plugin::Functions qw(:codes %ERRORS %STATUS_TEXT @STATUS_CODES);
5use Params::Validate qw(:all); 4use Params::Validate qw(:all);
6 5
6use 5.006;
7use strict; 7use strict;
8use warnings; 8use 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
706Copyright (C) 2006-2014 by Monitoring Plugin Team 706Copyright (C) 2014 by Monitoring Plugin Team
707Copyright (C) 2006-2014 by Nagios Plugin Development Team
707 708
708This library is free software; you can redistribute it and/or modify it 709This library is free software; you can redistribute it and/or modify it
709under the same terms as Perl itself, either Perl version 5.8.4 or, at your 710under 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 @@
1package Monitoring::Plugin::Config; 1package Monitoring::Plugin::Config;
2 2
3use 5.006;
3use strict; 4use strict;
5use warnings;
6
4use Carp; 7use Carp;
5use File::Spec; 8use File::Spec;
6use base qw(Config::Tiny); 9use base qw(Config::Tiny);
@@ -93,10 +96,12 @@ sub read_string
93sub write { croak "Write access not permitted" } 96sub write { croak "Write access not permitted" }
94 97
95# Return last file used by read(); 98# Return last file used by read();
96sub np_getfile { return $CURRENT_FILE; } 99sub mp_getfile { return $CURRENT_FILE; }
97 100
981; 1011;
99 102
103__END__
104
100=head1 NAME 105=head1 NAME
101 106
102Monitoring::Plugin::Config - read nagios plugin .ini style config files 107Monitoring::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
172Copyright (C) 2006-2014 Monitoring Plugin Development Team 177Copyright (C) 2014 by Monitoring Plugin Team
178Copyright (C) 2006-2014 by Nagios Plugin Development Team
173 179
174This library is free software; you can redistribute it and/or modify 180This library is free software; you can redistribute it and/or modify
175it under the same terms as Perl itself. 181it 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
3package Monitoring::Plugin::ExitResult; 1package Monitoring::Plugin::ExitResult;
4 2
3# Tiny helper class to return both output and return_code when testing
4
5use 5.006;
5use strict; 6use strict;
7use warnings;
6 8
7# Stringify to message 9# Stringify to message
8use overload '""' => sub { shift->{message} }; 10use overload '""' => sub { shift->{message} };
@@ -63,7 +65,8 @@ Originally:
63 65
64=head1 COPYRIGHT AND LICENSE 66=head1 COPYRIGHT AND LICENSE
65 67
66Copyright (C) 2006-2014 Monitoring Plugin Development Team 68Copyright (C) 2014 by Monitoring Plugin Team
69Copyright (C) 2006-2014 by Nagios Plugin Development Team
67 70
68This library is free software; you can redistribute it and/or modify 71This library is free software; you can redistribute it and/or modify
69it under the same terms as Perl itself. 72it 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 @@
1package 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
4package Monitoring::Plugin::Functions;
5
6use 5.006; 6use 5.006;
7
8use strict; 7use strict;
9use warnings; 8use warnings;
9
10use File::Basename; 10use File::Basename;
11use Params::Validate qw(:types validate); 11use Params::Validate qw(:types validate);
12use Math::Calc::Units; 12use 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
440Copyright (C) 2006-2014 Monitoring Plugin Development Team 440Copyright (C) 2014 by Monitoring Plugin Team
441Copyright (C) 2006-2014 by Nagios Plugin Development Team
441 442
442This library is free software; you can redistribute it and/or modify 443This library is free software; you can redistribute it and/or modify
443it under the same terms as Perl itself. 444it 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 @@
1package 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
6package Monitoring::Plugin::Getopt; 8use 5.006;
7
8use strict; 9use strict;
10use warnings;
11
9use File::Basename; 12use File::Basename;
10use Getopt::Long qw(:config no_ignore_case bundling); 13use Getopt::Long qw(:config no_ignore_case bundling);
11use Carp; 14use 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
864Copyright (C) 2006-2014 Monitoring Plugin Development Team 867Copyright (C) 2014 by Monitoring Plugin Team
868Copyright (C) 2006-2014 by Nagios Plugin Development Team
865 869
866This library is free software; you can redistribute it and/or modify 870This library is free software; you can redistribute it and/or modify
867it under the same terms as Perl itself. 871it 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 @@
1package Monitoring::Plugin::Performance; 1package Monitoring::Plugin::Performance;
2 2
3use 5.006; 3use 5.006;
4
5use strict; 4use strict;
6use warnings; 5use 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
289Copyright (C) 2006-2014 Monitoring Plugin Development Team 288Copyright (C) 2014 by Monitoring Plugin Team
289Copyright (C) 2006-2014 by Nagios Plugin Development Team
290 290
291This library is free software; you can redistribute it and/or modify 291This library is free software; you can redistribute it and/or modify
292it under the same terms as Perl itself. 292it 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 @@
1package Monitoring::Plugin::Range; 1package Monitoring::Plugin::Range;
2 2
3use 5.006; 3use 5.006;
4
5use strict; 4use strict;
6use warnings; 5use 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
164Copyright (C) 2006-2014 Monitoring Plugin Development Team 163Copyright (C) 2014 by Monitoring Plugin Team
164Copyright (C) 2006-2014 by Nagios Plugin Development Team
165 165
166This library is free software; you can redistribute it and/or modify 166This library is free software; you can redistribute it and/or modify
167it under the same terms as Perl itself. 167it 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 @@
1package Monitoring::Plugin::Threshold; 1package Monitoring::Plugin::Threshold;
2 2
3use 5.006; 3use 5.006;
4
5use strict; 4use strict;
6use warnings; 5use 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
129Copyright (C) 2006-2014 Monitoring Plugin Development Team 128Copyright (C) 2014 by Monitoring Plugin Team
129Copyright (C) 2006-2014 by Nagios Plugin Development Team
130 130
131This library is free software; you can redistribute it and/or modify 131This library is free software; you can redistribute it and/or modify
132it under the same terms as Perl itself. 132it under the same terms as Perl itself.
diff --git a/notes b/notes
index d1bddbf..fce006c 100644
--- a/notes
+++ b/notes
@@ -1,8 +1,8 @@
1RELEASING 1RELEASING
2 2
3Change version number in lib/Nagios/Plugin.pm and lib/Nagios/Plugin/Functions.pm 3Change version number in lib/Monitoring/Plugin.pm and lib/Monitoring/Plugin/Functions.pm
4Add date to Changes file 4Add date to Changes file
5svn commit 5git commit
6 6
7perl Makefile.PL 7perl Makefile.PL
8make 8make
@@ -11,5 +11,6 @@ make dist
11 11
12Upload file to CPAN 12Upload file to CPAN
13 13
14Send announcement to nagiosplug-help, nagios-announce 14Send announcement to announce@monitoring-plugins.org, help@monitoring-plugins.org and
15Add news item to http://nagiosplugins.org 15devel@monitoring-plugins.org
16Add 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
46THRESHOLDs for -w and -c are specified 'min:max' or 'min:' or ':max' 46THRESHOLDs 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 =>
75qq{-w, --warning=INTEGER:INTEGER 75qq{-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 =>
86qq{-c, --critical=INTEGER:INTEGER 86qq{-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 =>
94qq{-r, --result=INTEGER 94qq{-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
108unless ( defined $p->opts->warning || defined $p->opts->critical ) { 108unless ( 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);