
jhyland87
Novice
Mar 17, 2010, 2:23 PM
Post #3 of 3
(8280 views)
|
Re: [FishMonger] Win32_Processor and remote Load Percentage?
[In reply to]
|
Can't Post
|
|
Good idea on the dumper, didnt use that. Ive changed my code to
use 5.006; use warnings; use strict; use Win32::OLE; use Win32::OLE::Variant; use Data::Dumper; my $server = "xx.xx.xx.xx"; my $username = "administrator"; my $password = 'xxxxxxxxxxxx'; my $locator = Win32::OLE-> new("WbemScripting.SWbemLocator")or die "Can't access WMI on local machine.", Win32::OLE-> LastError; my $serverConn = $locator-> ConnectServer($server, "root/CIMV2", $username, $password) or die "Can't access WMI on remote machine $server: ", Win32::OLE-> LastError; my $colItems = $serverConn-> Get( "Win32_Processor" ) || die "Error: ".Win32::OLE-> LastError(); print Dumper($colItems); Which returns..
$VAR1 = bless( { 'Qualifiers_' => bless( { 'Count' => 4 }, 'Win32::OLE' ), 'Properties_' => bless( { 'Count' => 44 }, 'Win32::OLE' ), 'Methods_' => bless( { 'Count' => 2 }, 'Win32::OLE' ), 'Derivation_' => [ 'CIM_Processor', 'CIM_LogicalDevice', 'CIM_LogicalElement', 'CIM_ManagedSystemElement' ], 'Path_' => bless( { 'Path' => '\\\\xxxxx\\ROOT\\CIMV2:Win32_Processor', 'RelPath' => 'Win32_Processor', 'Server' => 'xxxxx', 'Namespace' => 'ROOT\\CIMV2', 'ParentNamespace' => 'ROOT', 'DisplayName' => 'WINMGMTS:{authenticationLevel=pkt,impersonationLevel=impersonate}!\\\\XXXXX\\ROOT\\CIMV2:Win32_Processor', 'Class' => 'Win32_Processor', 'IsClass' => 1, 'IsSingleton' => 0, 'Keys' => bless( { 'Count' => 0 }, 'Win32::OLE' ), 'Security_' => bless( { 'ImpersonationLevel' => 3, 'AuthenticationLevel' => 4, 'Privileges' => bless( { 'Count' => 0 }, 'Win32::OLE' ) }, 'Win32::OLE' ), 'Locale' => '', 'Authority' => '' }, 'Win32::OLE' ), 'Security_' => bless( { 'ImpersonationLevel' => 3, 'AuthenticationLevel' => 4, 'Privileges' => bless( { 'Count' => 0 }, 'Win32::OLE' ) }, 'Win32::OLE' ), 'SystemProperties_' => bless( { 'Count' => 10 }, 'Win32::OLE' ) }, 'Win32::OLE' ); Oddly enough, none of that actually has any information about the processor... interesting. Totally different than whats ran locally
|