[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 28/32: port check_{backuppc, nfsmounts, printer} to M::P
Jan Wagner
waja at moszumanska.debian.org
Fri Nov 18 17:23:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
waja pushed a commit to branch master
in repository pkg-nagios-plugins-contrib.
commit 777cf6915bc3e5210da5e957723b05bcf4c0c5c0
Author: Evgeni Golov <evgeni at golov.de>
Date: Sat Sep 24 23:00:23 2016 +0200
port check_{backuppc,nfsmounts,printer} to M::P
---
check_backuppc/control | 2 +-
check_nfsmounts/control | 2 +-
check_printer/control | 2 +-
debian/patches/check_backuppc/use_nagios_plugins | 31 ++++++++++++++++++++---
debian/patches/check_nfsmounts/nfs_write_location | 2 +-
debian/patches/check_nfsmounts/perl_module | 28 ++++++++++++++++++--
debian/patches/check_printer/use_nagios_plugin | 28 +++++++++++++++++---
7 files changed, 82 insertions(+), 13 deletions(-)
diff --git a/check_backuppc/control b/check_backuppc/control
index fb3af99..6897900 100644
--- a/check_backuppc/control
+++ b/check_backuppc/control
@@ -1,5 +1,5 @@
Uploaders: Jan Wagner <waja at cyconet.org>
-Recommends: libnagios-plugin-perl
+Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl
Suggests: backuppc
Version: 1.1.0
Homepage: http://n-backuppc.sourceforge.net/
diff --git a/check_nfsmounts/control b/check_nfsmounts/control
index a1d00f2..c79bdac 100644
--- a/check_nfsmounts/control
+++ b/check_nfsmounts/control
@@ -1,4 +1,4 @@
Homepage: http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_nfsmounts/details
-Recommends: libnagios-plugin-perl
+Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl
Uploaders: Bernd Zeimetz <bzed at debian.org>
Description: checks whether there are stale NFS mounts on the host
diff --git a/check_printer/control b/check_printer/control
index 01d73be..baa0b25 100644
--- a/check_printer/control
+++ b/check_printer/control
@@ -4,4 +4,4 @@ Uploaders: Bernd Zeimetz <bzed at debian.org>
Description: plugin to check printer supply levels using SNMP
It outputs performance data for all supplies
found, for example toner and drum.
-Recommends: snmp
+Recommends: snmp, libmonitoring-plugin-perl | libnagios-plugin-perl
diff --git a/debian/patches/check_backuppc/use_nagios_plugins b/debian/patches/check_backuppc/use_nagios_plugins
index 9154573..15bcf2a 100644
--- a/debian/patches/check_backuppc/use_nagios_plugins
+++ b/debian/patches/check_backuppc/use_nagios_plugins
@@ -1,11 +1,34 @@
---- a/check_backuppc/src/check_backuppc
-+++ b/check_backuppc/src/check_backuppc
-@@ -32,7 +32,7 @@ no utf8;
+diff --git a/check_backuppc/check_backuppc-1.1.0/check_backuppc b/check_backuppc/check_backuppc-1.1.0/check_backuppc
+index d8ea383..c994c20 100755
+--- a/check_backuppc/check_backuppc-1.1.0/check_backuppc
++++ b/check_backuppc/check_backuppc-1.1.0/check_backuppc
+@@ -32,7 +32,28 @@ no utf8;
# Nagios
use lib "NAGIOS_LIB";
-use utils qw(%ERRORS $TIMEOUT);
-+use Nagios::Plugin qw(%ERRORS);
++sub load_module {
++ my @names = @_;
++ my $module;
++ for my $name (@names) {
++ my $file = $name;
++ # requires need either a bare word or a file name
++ $file =~ s{::}{/}gsxm;
++ $file .= '.pm';
++ eval {
++ require $file;
++ $name->import(qw(%ERRORS));
++ $module = $name;
++ };
++ last if $module;
++ }
++ return $module;
++}
++
++my $plugin_module;
++BEGIN {
++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
use POSIX qw(strftime difftime);
use Getopt::Long;
Getopt::Long::Configure('bundling');
diff --git a/debian/patches/check_nfsmounts/nfs_write_location b/debian/patches/check_nfsmounts/nfs_write_location
index d353587..462883d 100644
--- a/debian/patches/check_nfsmounts/nfs_write_location
+++ b/debian/patches/check_nfsmounts/nfs_write_location
@@ -1,8 +1,8 @@
--- a/check_nfsmounts/check_nfsmounts
+++ b/check_nfsmounts/check_nfsmounts
@@ -23,6 +23,7 @@
+ }
- use Nagios::Plugin qw(%ERRORS);
use Time::HiRes qw{time alarm};
+use Sys::Hostname;
use Getopt::Long;
diff --git a/debian/patches/check_nfsmounts/perl_module b/debian/patches/check_nfsmounts/perl_module
index 8cb326d..86c8c81 100644
--- a/debian/patches/check_nfsmounts/perl_module
+++ b/debian/patches/check_nfsmounts/perl_module
@@ -1,11 +1,35 @@
+diff --git a/check_nfsmounts/check_nfsmounts b/check_nfsmounts/check_nfsmounts
+index fbfb1f8..51ed625 100644
--- a/check_nfsmounts/check_nfsmounts
+++ b/check_nfsmounts/check_nfsmounts
-@@ -21,14 +21,14 @@
+@@ -21,14 +21,36 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-use utils qw{$TIMEOUT %ERRORS};
-+use Nagios::Plugin qw(%ERRORS);
++sub load_module {
++ my @names = @_;
++ my $module;
++ for my $name (@names) {
++ my $file = $name;
++ # requires need either a bare word or a file name
++ $file =~ s{::}{/}gsxm;
++ $file .= '.pm';
++ eval {
++ require $file;
++ $name->import(qw(%ERRORS));
++ $module = $name;
++ };
++ last if $module;
++ }
++ return $module;
++}
++
++my $plugin_module;
++BEGIN {
++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
++
use Time::HiRes qw{time alarm};
use Getopt::Long;
use strict;
diff --git a/debian/patches/check_printer/use_nagios_plugin b/debian/patches/check_printer/use_nagios_plugin
index b1a2c52..36e7880 100644
--- a/debian/patches/check_printer/use_nagios_plugin
+++ b/debian/patches/check_printer/use_nagios_plugin
@@ -1,6 +1,8 @@
+diff --git a/check_printer/check_printer b/check_printer/check_printer
+index 6d801de..da8e099 100644
--- a/check_printer/check_printer
+++ b/check_printer/check_printer
-@@ -33,12 +33,7 @@
+@@ -33,11 +33,27 @@
use strict;
use warnings;
@@ -9,8 +11,28 @@
- use lib "/usr/local/libexec/nagios";
-} elsif ($OS =~ m/Linux/){
- use lib "/usr/local/nagios/libexec";
--}
-+use Nagios::Plugin qw(%ERRORS);
++sub load_module {
++ my @names = @_;
++ my $module;
++ for my $name (@names) {
++ my $file = $name;
++ # requires need either a bare word or a file name
++ $file =~ s{::}{/}gsxm;
++ $file .= '.pm';
++ eval {
++ require $file;
++ $name->import(qw(%ERRORS));
++ $module = $name;
++ };
++ last if $module;
++ }
++ return $module;
++}
++
++my $plugin_module;
++BEGIN {
++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
+ }
use Getopt::Long;
use Pod::Usage;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins-contrib.git
More information about the Pkg-nagios-changes
mailing list