Bret Goodfellow wrote:
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:
 
dev02: # su - nagios
[EMAIL PROTECTED]:~> ssh -i /usr/local/nagios/.ssh/id_dsa olympus "/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios password TS01 98 96"
mwmt01 : TS01 OK - 18.80% used [ 487 / 600 MB available ]|TS01=18.80%;96;98;0;100
[EMAIL PROTECTED]:~>
 
When I run the ssh command as root, this is where I get the failure:
 
[EMAIL PROTECTED]:~> su - root
dev02: #  ssh -i /usr/local/nagios/.ssh/id_dsa olympus "/usr/local/nagios/libexec/check_oracle --tablespace mwmt01 nagios password TS01 98 96"
CRITICAL - ORA-12154: TNS:could not resolve service name
 
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:
 
dev02: # su - nagios
[EMAIL PROTECTED]:~> /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" -l nagios
CRITICAL - ORA-12154: TNS:could not resolve service name
[EMAIL PROTECTED]:~>
 
Notice that the last two commands have the same result.  The first is using ssh as user root, and the second is using check_by_ssh as user nagios.  Yet, if I run ssh as user nagios I then get the expected response.  Any ideas?

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.

Cheers.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to