<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.3790.2759" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=750361717-10102006><FONT face=Arial
color=#0000ff 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><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=750361717-10102006>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=538290722-06102006><STRONG>dev02: # su -
nagios</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff 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 face=Arial color=#0000ff 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 face=Arial color=#0000ff size=2><SPAN
class=538290722-06102006><STRONG>nagios@dev02:~></STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=538290722-06102006><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff 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 face=Arial color=#0000ff size=2><SPAN class=538290722-06102006><SPAN
class=750361717-10102006></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff 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 face=Arial color=#0000ff 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 face=Arial
color=#0000ff size=2>:<SPAN class=750361717-10102006>
#</SPAN></FONT></STRONG></SPAN></DIV>
<DIV><SPAN class=538290722-06102006><STRONG><FONT face=Arial color=#0000ff
size=2><SPAN class=750361717-10102006></SPAN></FONT></STRONG></SPAN> </DIV>
<DIV><SPAN class=538290722-06102006><FONT face=Arial color=#0000ff 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 face=Arial color=#0000ff size=2><SPAN
class=750361717-10102006></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=538290722-06102006><FONT face=Arial color=#0000ff size=2><SPAN
class=750361717-10102006><SPAN class=750361717-10102006><FONT
face="Times New Roman" color=#000000 size=3></FONT>
<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></SPAN></SPAN></FONT></SPAN></SPAN></SPAN></SPAN></FONT><FONT
face=Arial color=#0000ff size=2><SPAN class=538290722-06102006><SPAN
class=750361717-10102006></SPAN></SPAN></FONT></DIV></DIV></DIV></DIV></SPAN></DIV></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=750361717-10102006></SPAN><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></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <B>On Behalf Of </B>Bret
Goodfellow<BR><B>Sent:</B> Friday, October 06, 2006 4:29 PM<BR><B>To:</B>
nagios-users@lists.sourceforge.net<BR><B>Subject:</B> [Nagios-users]
check_oracle plugin returns - CRITICAL - ORA-12154:TNS: count not resolve
service name<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>My Nagios server is
returning this error when executing the check_by_ssh plugin, which also includes
the check_oracle plugin. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>Here's the
scenario. </SPAN></FONT><FONT face=Arial size=2><SPAN
class=538290722-06102006>I have a remote server, called <U>olympus</U>, that is
running Oracle 9.2.0.6. I want to be able to monitor tablespace size using
the check_oracle plugin. I have copied the check_oracle plugin to the
remote server, <U>olympus</U>, and have successfully run the plugin on
<U>olympus</U>. When I run the check_oracle plugin I am logged in as
nagios. e.g. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG>nagios@olympus:~>
/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios password TS01
98 96</STRONG></SPAN></FONT></DIV>
<DIV><FONT 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 face=Arial size=2><SPAN
class=538290722-06102006><STRONG>nagios@olympus:~></STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>This is what I
expected. Now, from my Nagios Server, <U>dev02</U>, I would like to be
able to monitor the oracle tablespace on <U>olympus</U>. I first tested
ssh by executing the following command from <U>dev02</U>:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006><STRONG>dev02: # su
- nagios</STRONG></SPAN></FONT></DIV>
<DIV><FONT 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><FONT face=Arial size=2><SPAN class=538290722-06102006>
<DIV><FONT 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 face=Arial size=2><SPAN
class=538290722-06102006><STRONG>nagios@dev02:~></STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>As you can see, I
can ssh from my Nagios server and have it execute the check_oracle plugin on
<U>olympus</U>. Everything is good so far. My goal is to to setup
Nagios to run this. I now want to check the tabespace on <U>olympus</U> by
using the Nagios plugin: check_by_ssh. Below is the command that is
executed on <U>dev02</U> :</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG>nagios@dev02:~>
/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"</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006><STRONG>CRITICAL -
ORA-12154: TNS:could not resolve service name</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG>nagios@dev02:~>
</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=538290722-06102006><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=538290722-06102006>The last 2 commands
are both run from the Nagios Server. Why doesn't the check_by_ssh work,
yet the native ssh command does
work?</SPAN></FONT></DIV></SPAN></FONT></DIV></SPAN></FONT></DIV></SPAN></FONT></DIV></BODY></HTML>