[Pkg-nagios-devel] Bug#864173: check_backuppc does not compile
Peter Palfrader
weasel at debian.org
Sun Jun 4 18:53:54 UTC 2017
Package: nagios-plugins-contrib
Version: 21.20170222
Severity: important
Tags: patch
} root at ajax:~# sudo -u backuppc /usr/lib/nagios/plugins/check_backuppc -H ajax
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 99.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 123.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 124.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 129.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 137.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 147.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 177.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 240.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 260.
} Global symbol "%ERRORS" requires explicit package name (did you forget to declare "my %ERRORS"?) at /usr/lib/nagios/plugins/check_backuppc line 286.
} Execution of /usr/lib/nagios/plugins/check_backuppc aborted due to compilation errors.
} root at ajax:~#
This makes it work for me:
root at ajax:~# diff -u ./check_backuppc /usr/lib/nagios/plugins/check_backuppc
--- ./check_backuppc 2017-06-04 20:51:45.838141051 +0200
+++ /usr/lib/nagios/plugins/check_backuppc 2017-06-04 20:52:07.342331799 +0200
@@ -32,28 +32,7 @@
# Nagios
use lib "/usr/lib/nagios/plugins";
-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(qw(%ERRORS));
- $module = $name;
- };
- last if $module;
- }
- return $module;
-}
-
-my $plugin_module;
-BEGIN {
- $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
-}
+use utils qw(%ERRORS);
use POSIX qw(strftime difftime);
use Getopt::Long;
Getopt::Long::Configure('bundling');
} root at ajax:~# sudo -u backuppc /usr/lib/nagios/plugins/check_backuppc -H ajax
} BACKUPPC OK - (0/1) failures
Cheers,
More information about the Pkg-nagios-devel
mailing list