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
blob: dd8451af40974b3952158b33aa74c5ba3d548859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
+}
t/?h=config_version_lirion&id=7d3bd4ca2aa1ce4da3996152db4b78265b0e76cb'>adding script.shMarc McKinley 2021-05-121-0/+3 | * Merge pull request #100 from puppetlabs/binford2k-patch-1Ben Ford 2021-05-061-1/+8 |\ | | | | Add template instructions | * Update README.mdBen Ford 2021-05-051-1/+1 | | | | | | Co-authored-by: Reid Vandewiele <reid@puppet.com> | * Add template instructionsBen Ford 2021-05-051-1/+8 |/ * Merge pull request #97 from mcka1n/patch-1Reid Vandewiele 2021-05-041-3/+3 |\ | | | | update the version of the example modules | * update the version of the example modulesEdwin Maldonado 2021-05-041-3/+3 |/ * Merge pull request #91 from vulongtran/patch-1Reid Vandewiele 2020-10-211-2/+1 |\ | | | | Update README.md | * Update README.md Vu Long Tran 2020-10-211-2/+1 | | | | | | | | | | Sounds good Co-authored-by: Reid Vandewiele <reid@puppet.com> | * Update README.mdVu Long Tran 2020-10-191-1/+1 |/ | | Updating Code Manager link to the latest - https://puppet.com/docs/pe/2019.8/code_mgr.html. As old link has been updated. * Merge pull request #87 from mwaggett/codeownersReid Vandewiele 2020-09-101-1/+1 |\ | | | | (maint) Fix CODEOWNERS | * (maint) Fix CODEOWNERSMolly Waggett 2020-09-101-1/+1 |/ * Revert "add db2 module"Iristyle 2019-12-031-6/+0 | | | | This reverts commit bfb2d7a1828b22f7f7e5d4955743ccd9f08147db. * Revert "add db2_server role and profile"Iristyle 2019-12-032-22/+0 | | | | This reverts commit 58103e4ef4478f7c997c769a7111ca48cdf269eb. * Revert "include db2 class"Iristyle 2019-12-031-1/+0 | | | | This reverts commit 1041362ee1d4b0ea2e0328881bf4aea9771e76c2. * include db2 classJesse Reynolds 2019-11-301-0/+1 | * add db2_server role and profileJesse Reynolds 2019-11-302-0/+22 | * add db2 moduleJesse Reynolds