<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bret Goodfellow wrote:
<blockquote
cite="mid91EDB00F83BAD443A9D05FA67623955A862974@QMAIL.corp.questar.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.3790.2759" name="GENERATOR">
<div dir="ltr" align="left"><span class="750361717-10102006"><font
color="#0000ff" face="Arial" size="2">I'm wondering if this could be
some sort of authentication problem. When I run the ssh command as
nagios, I get the expected reponse:</font></span></div>
<div dir="ltr" align="left"><span class="750361717-10102006"></span> </div>
<div dir="ltr" align="left"><span class="750361717-10102006">
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong>dev02: # su - nagios</strong></span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong>nagios@dev02:~> ssh -i
/usr/local/nagios/.ssh/id_dsa olympus
"/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios
password TS01 98 96"</strong></span></font></div>
<div><span class="538290722-06102006">
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong>mwmt01 : TS01 OK - 18.80% used [
487 / 600 MB available ]|TS01=18.80%;96;98;0;100</strong></span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong>nagios@dev02:~></strong></span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong></strong></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><span class="750361717-10102006">When I run
the ssh command as root, this is where I get the failure:</span></span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><span class="750361717-10102006"></span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><span class="750361717-10102006"><strong>nagios@dev02:~>
su - root</strong></span></span></font></div>
<div><font><span class="538290722-06102006"><span
class="750361717-10102006"><font color="#0000ff"><font face="Arial"><font
size="2"><strong>dev02: #</strong> <strong>ssh -i
/usr/local/nagios/.ssh/id_dsa olympus
"/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios
password TS01 98 96"</strong></font></font></font>
<div><span class="538290722-06102006">
<div><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><strong><span class="538290722-06102006"><strong>CRITICAL
- ORA-12154: TNS:could not resolve service name</strong></span></strong></span></font></div>
<div><span class="538290722-06102006"><strong><a href="mailto:s@dev02"><font
face="Arial"><font size="2"><span class="750361717-10102006">d</span>ev02</font></font></a><font
color="#0000ff" face="Arial" size="2">:<span class="750361717-10102006">
#</span></font></strong></span></div>
<div><span class="538290722-06102006"><strong><font color="#0000ff"
face="Arial" size="2"><span class="750361717-10102006"></span></font></strong></span> </div>
<div><span class="538290722-06102006"><font color="#0000ff"
face="Arial" size="2"><span class="750361717-10102006">Now, notice
when I switch back to nagios and run check_by_ssh (not to be confused
with ssh), I get the same error as above:</span></font></span></div>
<div><span class="538290722-06102006"><font color="#0000ff"
face="Arial" size="2"><span class="750361717-10102006"></span></font></span> </div>
<div><span class="538290722-06102006"><font color="#0000ff"
face="Arial" size="2"><span class="750361717-10102006"><span
class="750361717-10102006">
<div><span class="538290722-06102006"><strong>dev02: # su - nagios</strong></span></div>
<div><span class="538290722-06102006"><span class="538290722-06102006">
<div><span class="538290722-06102006"><strong><a
href="mailto:nagios@dev02">nagios@dev02</a>:~>
/usr/local/nagios/libexec/check_by_ssh -H olympus -i
/usr/local/nagios/.ssh/id_dsa -C
"/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios
password TS01 98 96"<span class="750361717-10102006"> -l nagios</span></strong></span></div>
<div><span class="538290722-06102006"><strong>CRITICAL - ORA-12154:
TNS:could not resolve service name</strong></span></div>
<div><span class="538290722-06102006">
<div><span class="538290722-06102006"><strong>nagios@dev02:~> </strong></span></div>
</span></div>
</span></span><font color="#0000ff" face="Arial" size="2"><span
class="538290722-06102006"><span class="750361717-10102006"></span></span></font></div>
</span></span></font></span></div>
</span></div>
</span></span></font></div>
</span></div>
</span></div>
<div><font><font color="#0000ff" face="Arial" size="2"> </font></font></div>
<div><span class="750361717-10102006"></span><font><font
color="#0000ff" face="Arial" size="2"><font face="Arial"><font
color="#0000ff"><font size="2">N<span class="750361717-10102006">otice
that the last two commands have the same result. The first is using <strong>ssh</strong>
as user <u>root</u>, and the second is using <strong>check_by_ssh</strong>
as user <u>nagios</u>. Yet, if I run ssh as user nagios I then get
the expected response. Any ideas?</span></font></font></font><br>
</font></font></div>
<div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
<hr tabindex="-1"><font><font color="#0000ff" face="Arial" size="2"><font
face="Tahoma" size="2"><b></b></font></font></font></div>
</blockquote>
While I am not an Oracle guru, my first thoughts are that the user does
not have the necessary oracle environment variables setup, thus your
tnsnames.ora cannot be located. I'd start off by confirming that point
first, then try using tnsping to test that the tnsnames.ora is setup
correctly. I dont recall how SSH and environment variables inheritance
occurs, which may be another issue in itself.<br>
<br>
Cheers.<br>
</body>
</html>