[Nagiosplug-devel] [ nagiosplug-Bugs-1768817 ] check_linux_raid.pl compilation error

SourceForge.net noreply at sourceforge.net
Sat Sep 29 01:54:26 CEST 2007


Bugs item #1768817, was opened at 2007-08-06 22:01
Message generated for change (Comment added) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1768817&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Jonathan Mills (jonmills1)
>Assigned to: Ton Voon (tonvoon)
Summary: check_linux_raid.pl compilation error

Initial Comment:
The affected file is /usr/lib/nagios/plugins/contrib/check_linux_raid.pl
===================
ERROR:
[root at test4 contrib]# perl ./check_linux_raid.pl md0
Bareword "utils" not allowed while "strict subs" in use at ./check_linux_raid.pl line 26.
Bareword "pm" not allowed while "strict subs" in use at ./check_linux_raid.pl line 26.
BEGIN not safe after errors--compilation aborted at ./check_linux_raid.pl line 27.

====================

This appears to exist in even the latest versions of nagios-plugins.  The recommended fix is to replace line 26 with this:

use lib "utils.pm";

Thanks!

----------------------------------------------------------------------

>Comment By: Ton Voon (tonvoon)
Date: 2007-09-29 00:54

Message:
Logged In: YES 
user_id=664364
Originator: NO

Jonathan,

Thanks for the report and the patch.

This has been changed in the core code so that the line is 'use lib
"/usr/local/nagios/libexec";'.

The future direction for perl modules is to use the Nagios::Plugin CPAN
module. Also we are removing support of contrib plugins in future.

Ton


----------------------------------------------------------------------

Comment By: Jim Nelson (jnelson_neteasy)
Date: 2007-08-13 13:11

Message:
Logged In: YES 
user_id=1856924
Originator: NO

Here's a patch to fix that error in several files in the /contrib
directory - I submitted it on August 1st, but it doesn't show in the
archives...


--
diff -Nurp nagios-plugins-1.4.9-orig/contrib/check_apc_ups.pl
nagios-plugins-1.4.9/contrib/check_apc_ups.pl
--- nagios-plugins-1.4.9-orig/contrib/check_apc_ups.pl	2007-07-30
16:35:07.000000000 -0400
+++ nagios-plugins-1.4.9/contrib/check_apc_ups.pl	2007-07-30
16:36:21.000000000 -0400
@@ -13,7 +13,7 @@ use strict;
 use Getopt::Long;
 use vars qw($opt_V $opt_h $opt_H $opt_T $opt_t $opt_R $opt_r 
   $opt_L $opt_l $PROGNAME);
-use lib utils.pm;
+use lib 'utils.pm';
 use utils qw(%ERRORS &print_revision &support &usage);
 
 sub print_help ();
diff -Nurp nagios-plugins-1.4.9-orig/contrib/check_appletalk.pl
nagios-plugins-1.4.9/contrib/check_appletalk.pl
--- nagios-plugins-1.4.9-orig/contrib/check_appletalk.pl	2007-07-30
16:35:07.000000000 -0400
+++ nagios-plugins-1.4.9/contrib/check_appletalk.pl	2007-07-30
16:36:34.000000000 -0400
@@ -22,7 +22,7 @@ BEGIN {
 }
 
 use strict;
-use lib utils.pm;
+use lib 'utils.pm';
 
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use vars qw($PROGNAME);
diff -Nurp nagios-plugins-1.4.9-orig/contrib/check_linux_raid.pl
nagios-plugins-1.4.9/contrib/check_linux_raid.pl
--- nagios-plugins-1.4.9-orig/contrib/check_linux_raid.pl	2007-07-30
16:35:07.000000000 -0400
+++ nagios-plugins-1.4.9/contrib/check_linux_raid.pl	2007-07-30
16:36:59.000000000 -0400
@@ -23,7 +23,7 @@
 #	  WARNING md0 status=[UUU_U], recovery=46.4%, finish=123.0min
 
 use strict;
-use lib utils.pm;
+use lib 'utils.pm';
 use utils qw(%ERRORS);
 
 # die with an error if we're not on Linux
diff -Nurp nagios-plugins-1.4.9-orig/contrib/check_snmp_procs.pl
nagios-plugins-1.4.9/contrib/check_snmp_procs.pl
--- nagios-plugins-1.4.9-orig/contrib/check_snmp_procs.pl	2007-07-30
16:35:07.000000000 -0400
+++ nagios-plugins-1.4.9/contrib/check_snmp_procs.pl	2007-07-30
16:37:30.000000000 -0400
@@ -35,7 +35,7 @@
 #use strict;
 use Getopt::Long;
 use Net::SNMP qw (oid_lex_sort oid_base_match SNMP_VERSION_1);
-use lib utils.pm;
+use lib 'utils.pm';
 use utils qw(%ERRORS &print_revision &support &usage);
 
 my $PROGNAME="check_snmp_procs";


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1768817&group_id=29880




More information about the Devel mailing list