joeheb has asked for the wisdom of the Perl Monks concerning the following question:

I've been tasked with trying to retreive PC info for remote PC's on our network, specifically Make and Model of PC's on the network. Are there flat files this information is kept in and Is there Perl functionality to accomplish this. Thanks, Joe. pgjm@heb.com or joepgjm@aol.com

Replies are listed 'Best First'.
Re: Remote PC info
by DamnDirtyApe (Curate) on Nov 06, 2002 at 15:57 UTC

    As for the first question, I don't believe this is stored in a file anywhere, though if your using *nix you may be able to extract some useful info using the dmesg command.

    As for the second question, that really depends on how your system is designed; something derived from this client-server system might be useful to you.

    HTH...


    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
      Thanks for your reply. I really like your phrase quoted by Friedrich Nietzsche.
Re: Remote PC info
by Mr. Muskrat (Canon) on Nov 06, 2002 at 17:45 UTC

    Okay, there are plenty of modules for dealing with Win32 systems. Looking at win32 and win32api will show you just how many there are!

    For your situation, I think that I'd use Win32::TieRegistry to look up that information in the registry of the various networked PCs.

    You might want to look through HKEY_LOCAL_MACHINE\enum.

    Updated: Oops! What was I thinking? The registry will hold the information on the specific hardware components. Make and Model are in a file called oeminfo.ini. On Win9x systems it is in c:\windows\system. On Win2k, it is in c:\winnt\system32. Config::IniFiles should come to the rescue with reading the info.

      The oeminfo.ini file looks like this:
      [general] Manufacturer = Flybynight Computer Mfg. Model = Rip-U-Off 4000 [support information] Line1 = Support? You want support? Line2 = Don't call us! Line3 = Seriously. Line4 = We mean it!

      So you could use something like this:

      #!perl use strict; use warnings; use Config::IniFiles; my $cfg = new Config::IniFiles(-file => "c:/windows/system/oeminfo.ini +" ); my $make = $cfg->val('general', 'Manufacturer'); my $model = $cfg->val('general', 'Model'); print "Make: $make\n"; print "Model: $model\n";
      And if you have some network shares set up, you can map drives and use those drive letters.

      This is what I was looking for. Thanks. I can just parse this file and utilize what I need. Thanks.
Re: Remote PC info
by Mr. Muskrat (Canon) on Nov 06, 2002 at 15:55 UTC

    Hi joeheb and welcome to Perl Monks.

    What operating system(s) are we dealing here?
    The answer to your questions will vary greatly depending on the OS.

      W/98-2000. Thanks for your reply.