Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Perl $ENV hash

by kingjamesid (Acolyte)
on Apr 20, 2010 at 13:48 UTC ( #835772=perlquestion: print w/ replies, xml ) Need Help??
kingjamesid has asked for the wisdom of the Perl Monks concerning the following question:

Hello-

I understand how to pull out (a particular) ENV variable/value pairs from my machine, but i need to get the same pair from a list of machines. For e.g. I have a system var "T_VERSION" in all machines I support. about 100 of them. i am trying to pull out the values of this var from all 100 machines and export to a txt file.

I am not sure, how to get to other's ENV hash and get it. Any idea?

Comment on Perl $ENV hash
Re: Perl $ENV hash
by Anonymous Monk on Apr 20, 2010 at 13:52 UTC
    log into said machine (ssh, whatever), set up env (load profile, whatever), call printenv and send the results back to your machine
Re: Perl $ENV hash
by choroba (Abbot) on Apr 20, 2010 at 13:52 UTC
    What method do you use to connect to the machines?
Re: Perl $ENV hash
by Corion (Pope) on Apr 20, 2010 at 13:56 UTC

    It's quite simple. On Windows, if you have Domain Administrator privileges, you can use WMI to query each machine. Otherwise, you'll have to log into each machine and query the environment information there.

      corion-
      I have domain admin privileges. how can I makes sure, i have WMIC libraries installed. Is this defauly?
      I ran perldoc WIN32::WMI but it said no docs found. so I am assuming lib not loaded.
      can you help me get started on where to look for the lib or if its already installed.
      THanks.
Re: Perl $ENV hash
by roboticus (Canon) on Apr 20, 2010 at 17:03 UTC

    Kingjamesid

    Please note that the environment isn't machine-specific--rather it's account-specific. So you could have any number of T_VERSION values for a machine.

    ...roboticus

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://835772]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-08-22 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (153 votes), past polls