Strange NRPE Problem...

kyle.odonnell at gmail.com kyle.odonnell at gmail.com
Mon Apr 28 16:50:03 CEST 2008


Does it work locally if you run it as the same user as the NRPE daemon
is running?

On 4/28/08, Gavin Williams <Gavin.Williams at card.co.uk> wrote:
> Hi there,
>
>
>
> I'm having some strange NRPE behaviour.
>
> I've written a Perl script that runs a load of checks on our systems,
> but the ones that are causing the problem are any checks that want to
> connect to Oracle via DBI.
>
>
>
> The error it's giving me is:
>
> DBI connect('','',...) failed: ORA-12560: TNS:protocol adapter error
> (DBD ERROR: OCIServerAttach) at nagios_checks.pl line 82
>
>
>
> Now this command works fine if I run it locally on the server, however
> when using NRPE it throws the above error.
>
>
>
> The lines in question in my script look like this:
>
> sub dbConnect
>
> {
>
>             my $dbh;
>
>             eval
>
>             {
>
>                         $dbh =
> DBI->connect("dbi:Oracle:$database","$username","$password",{ RaiseError
> => 1, AutoCommit => 0, PrintError => 0})
>
>                         || die "failed to connect to $database\n";
>
>             };
>
>             if ($@)
>
>             {
>
>                         my $msg .= $@."\n";
>
>                         die "$msg\n";
>
>             }
>
>
>
>             return $dbh;
>
> }
>
> The username, password and database get loaded in from a XML Config
> file... But it all works locally???
>
>
>
> Any ideas?
>
>
>
> Cheers
>
> Gavin
>
>
> ________________________________________________________________________
> Please consider the environment - do you really need to print this email?
> ________________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System - http://www.messagelabs.com.
> ________________________________________________________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list