First, "urgent" makes a bad subject.
Second,
Quote:
Originally Posted by investmentbnker75
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