Debian Codegraph @

debian/patches/check_nfsmounts/perl_module

raw
1 Index: pkg-nagios-plugins-contrib/check_nfsmounts/check_nfsmounts
2 ===================================================================
3 --- pkg-nagios-plugins-contrib.orig/check_nfsmounts/check_nfsmounts
4 +++ pkg-nagios-plugins-contrib/check_nfsmounts/check_nfsmounts
5 @@ -21,14 +21,36 @@
6 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7 #
8
9 -use utils qw{$TIMEOUT %ERRORS};
10 +sub load_module {
11 + my @names = @_;
12 + my $module;
13 + for my $name (@names) {
14 + my $file = $name;
15 + # requires need either a bare word or a file name
16 + $file =~ s{::}{/}gsxm;
17 + $file .= '.pm';
18 + eval {
19 + require $file;
20 + $name->import(qw(%ERRORS));
21 + $module = $name;
22 + };
23 + last if $module;
24 + }
25 + return $module;
26 +}
27 +
28 +my $plugin_module;
29 +BEGIN {
30 + $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
31 +}
32 +
33 use Time::HiRes qw{time alarm};
34 use Getopt::Long;
35 use strict;
36
37 my $version="1.0";
38
39 -my $nfs_timeout=$TIMEOUT;
40 +my $nfs_timeout=15;
41 my $nfs_warn=-1;
42 my $writemode=0;
43 my $help=0;