[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 27/32: adopt check_{httpd_status, libvirt, memory, smstools} for 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 ecadcc629956ab67447fa056e641db74ac8d3b5a
Author: Evgeni Golov <evgeni at golov.de>
Date:   Sat Sep 24 19:33:49 2016 +0200

    adopt check_{httpd_status,libvirt,memory,smstools} for m::p
---
 check_httpd_status/control                         |  2 +-
 check_libvirt/control                              |  2 +-
 check_memory/control                               |  2 +-
 check_smstools/control                             |  1 +
 .../patches/check_httpd_status/monitoring-plugin   | 50 ++++++++++++++++++++++
 debian/patches/check_libvirt/monitoring-plugin     | 48 +++++++++++++++++++++
 debian/patches/check_memory/monitoring-plugin      | 43 +++++++++++++++++++
 debian/patches/check_smstools/monitoring-plugin    | 46 ++++++++++++++++++++
 debian/patches/series                              |  4 ++
 9 files changed, 195 insertions(+), 3 deletions(-)

diff --git a/check_httpd_status/control b/check_httpd_status/control
index 89529d4..3e86a03 100644
--- a/check_httpd_status/control
+++ b/check_httpd_status/control
@@ -1,6 +1,6 @@
 Homepage: http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_httpd_status.pl?view=log
 Watch: http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_httpd_status.pl?view=log <a name="(rev[^"]+)"></a>
-Recommends: liblocale-gettext-perl, libnagios-plugin-perl, liblwp-useragent-determined-perl
+Recommends: liblocale-gettext-perl, libmonitoring-plugin-perl | libnagios-plugin-perl, liblwp-useragent-determined-perl
 Version: rev153
 Uploaders: Jan Wagner <waja at cyconet.org>
 Description: plugin checking Apache or Lighthttpd
diff --git a/check_libvirt/control b/check_libvirt/control
index c8fd282..c047c19 100644
--- a/check_libvirt/control
+++ b/check_libvirt/control
@@ -1,5 +1,5 @@
 Homepage: http://git.op5.org/gitweb?p=system-addons/plugins/op5/check_libvirt.git;a=summary
-Recommends: libnagios-plugin-perl, libxml-simple-perl
+Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl, libxml-simple-perl
 Suggests: libsys-virt-perl
 Version: v7.0.3
 Uploaders: Bernd Zeimetz <bzed at debian.org>
diff --git a/check_memory/control b/check_memory/control
index e13d579..e201421 100644
--- a/check_memory/control
+++ b/check_memory/control
@@ -5,5 +5,5 @@ Description: plugin to check for free memory
  This plugin excludes the system cache and buffer, because
  on some system with very stable memory usage it is perfectly
  normal for system cache to fill in all available memory.
-Recommends: libnagios-plugin-perl (>= 0.31)
+Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl (>= 0.31)
 Version: 1.0.1
diff --git a/check_smstools/control b/check_smstools/control
index d57d984..255eb1b 100644
--- a/check_smstools/control
+++ b/check_smstools/control
@@ -3,4 +3,5 @@ Uploaders: Bernd Zeimetz <bzed at debian.org>
 Description: plugin to check GSM Modems using smstools
  check_smstools is a plugin to monitor a GSM modem
  signal quality and registration status with smstools.
+Recommends: libmonitoring-plugin-perl | libnagios-plugin-perl
 Suggests: smstools (>= 3~)
diff --git a/debian/patches/check_httpd_status/monitoring-plugin b/debian/patches/check_httpd_status/monitoring-plugin
new file mode 100644
index 0000000..1ec9fd4
--- /dev/null
+++ b/debian/patches/check_httpd_status/monitoring-plugin
@@ -0,0 +1,50 @@
+diff --git a/check_httpd_status/check_httpd_status b/check_httpd_status/check_httpd_status
+index bc5e809..f8a1350 100644
+--- a/check_httpd_status/check_httpd_status
++++ b/check_httpd_status/check_httpd_status
+@@ -32,8 +32,28 @@ use File::Basename;			# get basename()
+ use POSIX qw(setlocale);
+ use Locale::gettext;
+ 
+-use Nagios::Plugin ;
++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();
++            $module = $name;
++		};
++		last if $module;
++    }
++    return $module;
++}
+ 
++my $plugin_module;
++BEGIN {
++	$plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
+ use LWP::UserAgent;
+ use HTTP::Status; # get status_message()
+ use Time::HiRes qw(gettimeofday tv_interval);
+@@ -90,7 +110,7 @@ my %TranslationTable = (
+ );
+ 
+ 
+-my $np = Nagios::Plugin->new(
++my $np = $plugin_module->new(
+ 	version => $VERSION,
+ 	blurb => _gt('Apache / Lighthttpd server status monitor for Nagios'),
+ 	usage => "Usage: %s [ -H <host> [-p <port>] [-t <timeout>] [-w <warn_level> -c <crit_level>] [-V] [-u <url>] [-U user -P pass -r realm]",
+@@ -436,4 +456,4 @@ Note :
+         Warn if less than 100 workers are available
+         Crit if less than 10 workers are available
+ EOT
+-}
+\ No newline at end of file
++}
diff --git a/debian/patches/check_libvirt/monitoring-plugin b/debian/patches/check_libvirt/monitoring-plugin
new file mode 100644
index 0000000..c51c873
--- /dev/null
+++ b/debian/patches/check_libvirt/monitoring-plugin
@@ -0,0 +1,48 @@
+diff --git a/check_libvirt/check_libvirt b/check_libvirt/check_libvirt
+index 2029c9e..618d1ac 100755
+--- a/check_libvirt/check_libvirt
++++ b/check_libvirt/check_libvirt
+@@ -27,11 +27,33 @@
+ use strict;
+ use warnings;
+ use vars qw($PROGNAME $VERSION $output $result);
+-use Nagios::Plugin;
+ use File::Basename;
+ use Sys::Virt;
+ use XML::Simple;
+ 
++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();
++            $module = $name;
++		};
++		last if $module;
++    }
++    return $module;
++}
++
++my $plugin_module;
++BEGIN {
++	$plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
++
+ $PROGNAME = basename($0);
+ $VERSION = '0.1.0';
+ my $spooldir="/opt/monitor/var/check_libvirt";
+@@ -41,7 +63,7 @@ if (!-d $spooldir)
+ 	mkdir($spooldir);
+ }
+ 
+-my $np = Nagios::Plugin->new(
++my $np = $plugin_module->new(
+   usage => "Usage: %s -H <hosturl> [ -N <vmname> ]\n"
+     . "    [-u <user> -p <pass>]\n"
+     . "    -l <command> [ -s <subcommand> ]\n"
diff --git a/debian/patches/check_memory/monitoring-plugin b/debian/patches/check_memory/monitoring-plugin
new file mode 100644
index 0000000..8303246
--- /dev/null
+++ b/debian/patches/check_memory/monitoring-plugin
@@ -0,0 +1,43 @@
+diff --git a/check_memory/check_memory b/check_memory/check_memory
+index bf46711..4f272d1 100644
+--- a/check_memory/check_memory
++++ b/check_memory/check_memory
+@@ -23,14 +23,36 @@
+ use strict;
+ use warnings;
+ use vars qw($PROGNAME $VERSION $FREECMD $UNIT);
+-use Nagios::Plugin;
++
++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();
++            $module = $name;
++		};
++		last if $module;
++    }
++    return $module;
++}
++
++my $plugin_module;
++BEGIN {
++	$plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
+ 
+ $PROGNAME = "check_memory";
+ $VERSION = '1.0.1';
+ $FREECMD = '/usr/bin/free';
+ $UNIT = 'M';
+ 
+-my $np = Nagios::Plugin->new(
++my $np = $plugin_module->new(
+   usage => "Usage: %s [ -w <warning_threshold> ] [ -c <critical_threshold> ]\n"
+     . '   [ -u <unit> ]',
+   version => $VERSION,
diff --git a/debian/patches/check_smstools/monitoring-plugin b/debian/patches/check_smstools/monitoring-plugin
new file mode 100644
index 0000000..1715f96
--- /dev/null
+++ b/debian/patches/check_smstools/monitoring-plugin
@@ -0,0 +1,46 @@
+diff --git a/check_smstools/bin/check_smstools b/check_smstools/bin/check_smstools
+index a7a0336..707d289 100755
+--- a/check_smstools/bin/check_smstools
++++ b/check_smstools/bin/check_smstools
+@@ -13,9 +13,31 @@
+ 
+ use strict;
+ use warnings;
+-use Nagios::Plugin;
+ use POSIX;
+ 
++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();
++            $module = $name;
++		};
++		last if $module;
++    }
++    return $module;
++}
++
++my $plugin_module;
++BEGIN {
++	$plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
++}
++
+ # Define regular expressions used to find the correct lines from
+ # the status file
+ my $signal_command = 'AT\+CSQ';
+@@ -45,7 +67,7 @@ my $timestamp;
+ my $np;
+ 
+ sub init_plugin {
+-	$np = Nagios::Plugin->new(usage => "usage: %s");
++	$np = $plugin_module->new(usage => "usage: %s");
+ 
+ 	$np->add_arg(
+ 		spec => 'warning|w=f',
diff --git a/debian/patches/series b/debian/patches/series
index f777317..6052124 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,14 +10,17 @@ check_email_delivery/paths
 check_haproxy/epn
 check_haproxy/monitoring-plugin
 check_httpd_status/epn
+check_httpd_status/monitoring-plugin
 check_imap_quota/syntax_error_fix
 check_libs/lsof-speedup
 check_libs/config_path
 check_libs/space_before_deleted
+check_libvirt/monitoring-plugin
 check_lm_sensors/manpage_whatis_fix
 check_lm_sensors/spelling_errors
 check_lm_sensors/interpreter
 check_memory/new_free
+check_memory/monitoring-plugin
 check_nfsmounts/perl_module
 check_nfsmounts/nfs_write_location
 check_printer/use_data_dumper_if_needed
@@ -28,6 +31,7 @@ check_rbl/interpreter
 check_rbl/spelling_errors
 check_rbl/disable_dul.ru
 check_rbl/additional_rbls
+check_smstools/monitoring-plugin
 check_snmp_time/epn
 check_varnish/automake_foreign
 check_varnish/support-for-varnish-4

-- 
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