From 1e2387474a449452b78520b9ad96a8b4b5e99722 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Wed, 17 Apr 2019 19:07:19 +0200 Subject: initial commit of source fetch --- .../patches/check_httpd_status/monitoring-plugin | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin (limited to 'nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin') diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin new file mode 100644 index 0000000..dd8451a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin @@ -0,0 +1,49 @@ +--- a/check_httpd_status/check_httpd_status ++++ b/check_httpd_status/check_httpd_status +@@ -34,8 +34,28 @@ + 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); +@@ -92,7 +112,7 @@ + ); + + +-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 [-p ] [-t ] [-w -c ] [-V] [-u ] [-U user -P pass -r realm]", +@@ -438,4 +458,4 @@ + Warn if less than 100 workers are available + Crit if less than 10 workers are available + EOT +-} +\ No newline at end of file ++} -- cgit v1.2.3