Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i want to use a PERL script, but when i run i get a lot of error messages :s
i have perl installed...
even when i do '--help' i get these messages:
Code:
# ./check_oracle.pl --help
./check_oracle.pl: line 9: use: command not found
./check_oracle.pl: line 10: use: command not found
./check_oracle.pl: line 11: use: command not found
./check_oracle.pl: line 12: use: command not found
./check_oracle.pl: line 13: use: command not found
./check_oracle.pl: line 15: our: command not found
./check_oracle.pl: line 17: our: command not found
./check_oracle.pl: line 18: our: command not found
./check_oracle.pl: line 19: our: command not found
./check_oracle.pl: line 20: our: command not found
./check_oracle.pl: line 22: syntax error near unexpected token `('
./check_oracle.pl: line 22: `our %status_text = ('
i geuss it has to do something with those commands.. but can i resolve that or can't RHEL work with perl scripts?
This looks like an error in the script itself and is (probably) not rhel related.
Can you post the output of the following command: head -22 check_oracle.pl This way we can see what the script looks like and what might be wrong with the lines mentioned.
i've found the problem, something wasn't put in the code:
Code:
#!/usr/bin/perl
i've downloaded it, so i didn't wrote it... but even now, i still having some problems
Code:
# ./check_oracle.pl --help
Can't locate Win32/TieRegistry.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl .) at ./check_oracle.pl line 14.
BEGIN failed--compilation aborted at ./check_oracle.pl line 14.
and this is what's on line 14
Code:
use Win32::TieRegistry;
i geuss it has to do something with a WINDOWS OS, but i'm on linux, so i've put it in commentary
then i get this
Code:
# ./check_oracle.pl --help
Global symbol "$Registry" requires explicit package name at ./check_oracle.pl line 70.
Execution of ./check_oracle.pl aborted due to compilation errors.
aaaand that is something which i don't understand.. can someone help me
---------- Post added 05-02-11 at 02:59 PM ----------
Quote:
Originally Posted by druuna
Hi,
This looks like an error in the script itself and is (probably) not rhel related.
Can you post the output of the following command: head -22 check_oracle.pl This way we can see what the script looks like and what might be wrong with the lines mentioned.
Code:
#!/usr/bin/perl
#####################
#
# check_oracle.pl - Nagios NRPE plugin to check Oracle
#
# This program is distributed under the Artistic License.
# (http://www.opensource.org/licenses/artistic-license.php)
# Copyright 2007, Tevfik Karagulle, ITeF!x Consulting (http://itefix.no)
use strict;
use warnings;
use Getopt::Long;
#use Win32::TieRegistry;
use File::Temp qw/ tempfile tempdir /;
our $VERSION = "1.0";
our $OK = 0;
our $WARNING = 1;
our $CRITICAL = 2;
our $UNKNOWN = 3;
This: use Win32::TieRegistry; tells perl to use a specific (windows specific) module and this (line 70) $oraclehome = $oraclehome || $ENV{ORACLE_HOME} || $Registry->{"LMachine\\SOFTWARE\\ORACLE\\ORACLE_HOME"}; uses that specific module.
Commenting out the use Win32::TieRegistry; line, will create an error on line 70 'cause the module isn't there.
This looks like a windows specific nagios perl script that checks oracle, guess you need to look further for a linux/unix specific one.
This: use Win32::TieRegistry; tells perl to use a specific (windows specific) module and this (line 70) $oraclehome = $oraclehome || $ENV{ORACLE_HOME} || $Registry->{"LMachine\\SOFTWARE\\ORACLE\\ORACLE_HOME"}; uses that specific module.
Commenting out the use Win32::TieRegistry; line, will create an error on line 70 'cause the module isn't there.
This looks like a windows specific nagios perl script that checks oracle, guess you need to look further for a linux/unix specific one.
Hope this helps.
thx ^^, then there is nothing else i can do but indeed looking further for another one !!
This little how-to set up perlbrew and cpanm might be of help for you, if not now then at another time (when searching for a module)
(it might also not be, i am very far from knowing about perl. I just started). https://gist.github.com/797924
PS: building with perlbrew takes a long, don't worry if it takes long.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.