CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
How to get envirinment variable from multiple servers using perl

 



Nithya
New User

Oct 10, 2014, 8:55 AM

Post #1 of 4 (44248 views)
How to get envirinment variable from multiple servers using perl Can't Post

Hi Team,

I have written script to get the environment variable as input and list some files.
-> cat env.pl
#!/usr/bin/perl
$x=`ssh testserver ls -l $ENV{TNS_ADMIN}/tnsnames.ora`;
print $x;

it is not working fine. Throwing error. It is throwing error as below. It is not taking the output of $ENV{TNS_ADMIN} in testserver. Please help me. It is urgent.
./env.pl <http:/http://env.pl//>
cat: 0652-050 Cannot open /tnsnames.ora.


Code
[ksnithyaaix@gmail.com] 


(This post was edited by Nithya on Oct 10, 2014, 9:36 AM)


Laurent_R
Veteran / Moderator

Oct 10, 2014, 10:20 AM

Post #2 of 4 (44243 views)
Re: [Nithya] How to get envirinment variable from multiple servers using perl [In reply to] Can't Post

It seems that the $TNS_ADMIN environment variable is not defined when you log with ssh. Maybe you have to source an Oracle configuration script before. I have the feeling that this question has little to do with Perl and more with Unix and Oracle configuration scripts.

Did you try using ssh manually, not in a Perl script?


Nithya
New User

Oct 10, 2014, 10:55 AM

Post #3 of 4 (44242 views)
Re: [Laurent_R] How to get envirinment variable from multiple servers using perl [In reply to] Can't Post

Hi Sir, I tried manually also it is not working. even i tried to get common environment variable also. It also not working.


Laurent_R
Veteran / Moderator

Oct 11, 2014, 10:09 AM

Post #4 of 4 (44183 views)
Re: [Nithya] How to get envirinment variable from multiple servers using perl [In reply to] Can't Post

This confirms that this is not really a Perl problem, but a configuration issue in your Unix/Linux (whatever) and Oracle set up. It will probably be next to impossible to help you without access to the servers. If you can, ask some help from your system admins and DBAs.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives