LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-02-2011, 08:50 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
RHEL 4 and perl


hi all,

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?

greetz
 
Old 05-02-2011, 08:56 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
 
1 members found this post helpful.
Old 05-02-2011, 08:58 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
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.
this is on line 70
Code:
$oraclehome = $oraclehome || $ENV{ORACLE_HOME} || $Registry->{"LMachine\\SOFTWARE\\ORACLE\\ORACLE_HOME"};
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 View Post
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;
 
Old 05-02-2011, 09:07 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

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.
 
1 members found this post helpful.
Old 05-02-2011, 09:13 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi again,

Have a look here: Nagios - Category: Oracle Maybe a script to your liking is present.

Hope this helps.
 
1 members found this post helpful.
Old 05-02-2011, 09:14 AM   #6
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by druuna View Post
Hi,

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 !!
 
Old 05-02-2011, 09:15 AM   #7
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by druuna View Post
Hi again,

Have a look here: Nagios - Category: Oracle Maybe a script to your liking is present.

Hope this helps.
thx for the link, but i'm already searching on that website but there are so many plugins... but thx anyways ^^
 
Old 05-02-2011, 09:16 AM   #8
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl versions (was Koha on RHEL 5.3) Sanford Stein Linux - Software 7 07-23-2009 11:04 AM
Perl Debugging in RHEL - 5 pramod.srk Linux - Newbie 2 05-21-2009 10:35 AM
how to install the Perl 5.10 in RHEL 5.0 with Perl GD jpmaxyusuf Linux - Software 1 10-21-2008 12:02 PM
Apache doesn't start on RHEL 4.0 / PERL 5.8 roll_dom Linux - Software 2 06-29-2007 04:19 PM
perl | DBI->connect | RHEL AS 3 kaN5300 Linux - Enterprise 6 09-14-2004 09:15 AM


All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration