git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin')
-rw-r--r--nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin49
1 files changed, 49 insertions, 0 deletions
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 <host> [-p <port>] [-t <timeout>] [-w <warn_level> -c <crit_level>] [-V] [-u <url>] [-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
++}