LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-12-2008, 06:47 PM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
Urgent help needed with check_oracle_generic!


Has anyone ever got this plugin to work, check_oracle_generic? It can be found at: http://nagiosexchange.altinity.org/n...oracle_generic

This one is stumping me. I cant get it to run through Nagios or through nrpe. nrpe returns that it cant return the output. When i configure it on the nagios server to run and go get the commands from the monitored server i get (not using nrpe) i get this errror:

**ePN failed to compile /usr/local/nagios/libexec/check_oracle_generic: "Global symbol "$SID" requires explicit package name at (eval 1) line 74,

But command line it works on both the Nagios server and the server being monitored.

Here is my checkcommands.cfg:

define command{
command_name check_oracle_generic
command_line $USER1$/check_oracle_generic -SID=$ARG1$ -dbuser=$ARG2$ -dbpassword=$ARG3$ -w=$ARG4$ -c=$ARG5$ -q=$ARG6$
}

Here is my services.cfg:

define service{
use generic-service-short
host_name server name
service_description oracle application cron
check_command check_oracle_generic!SID name!dbuser!dbpasswd!660!800!"select count(*) from c_asset_version where markup_status='PENDING'"

If anyone can tell me where the problem is in the way im doing this, im suspecting im missing something. If anyone can help me out with how nrpe should be set up as an alternative ill go that route as well.

Thanks in advance

Last edited by investmentbnker75; 05-06-2008 at 10:03 PM.
 
Old 04-13-2008, 03:58 PM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Lightbulb

First, "urgent" makes a bad subject.

Second,
Quote:
Originally Posted by investmentbnker75 View Post
i get this errror:

**ePN failed to compile /usr/lib64/nagios/plugins/check_oracle_generic: "Global symbol "$SID" requires explicit package name at (eval 1) line 74,

If anyone can tell me where the problem is in the way im doing this, im suspecting im missing something.
In a nutshell, "::main" :-)

Well the message looks a lot like a Perl error that you get with use strict, maybe use strict variables. And following your link, sure enought it's a Perl script. The error is reported here, on the line after the "if":
Code:
# check user's inputs
sub check_arguments
{
	if (!$SID || !$dbuser || !$dbpassword || !$w || !$c || !$q)
	{    # this is line 74
		print ("Invalid argument(s) !\n");
		&usage;
		exit $ERRORS->{'UNKNOWN'};
	}
}
The error message is quite to the point: you access the global variable $SID without giving an explicit package name. (The switch -s turns on rudimentary switch processing, which causes your value ($ARG1$) to be assigned to the variable $SID, etc. That's what makes it sometimes work.)

As it doesn't use strict explicitly, the sloppy code will run from the command line. Apparently nagios turns on "strict" for you, which is probably a good idea -- maybe in some wrapper, as hinted by "(eval 1)".

To fix: you could try to explicitly refer to $main::SID etc. instead of $SID etc.

Further: consider including use strict; at the top of the script, that way you'll get consistent behavior. While you're at it, use warnings; too; it can be very helpful.

Good luck
/Quigi
 
  


Reply



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
Urgent - Help Needed rigel_kent Linux - General 1 07-21-2005 08:20 AM
Please Urgent Help Needed Here !!! dezeque Linux - General 6 05-26-2005 03:37 PM
Urgent Help Needed rankxeros Linux - Security 5 03-08-2004 04:32 PM
Urgent help needed the_twister Linux - Security 4 08-13-2003 09:58 AM
Urgent help needed J_Szucs Linux - Newbie 7 07-09-2002 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:24 PM.

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
Open Source Consulting | Domain Registration