
jhyland87
Novice
Mar 16, 2010, 5:07 PM
Views: 4429
|
|
Win32_Processor and remote Load Percentage?
|
|
|
So im trying to execute this from my local work station, and I cant seem to find anything wrong with it, it should work, as far as I can tell. All it does is go into a remote server, and get the LoadPercentage out of the Win32_Processor object
use 5.006; use Win32::OLE; use Win32::OLE::Variant; $server = "xxx.xxx.xxx.xxx"; $username = "administrator"; $password = 'xxxxxxxxxxxxx'; $locator = Win32::OLE-> new("WbemScripting.SWbemLocator")or die "Can't access WMI on local machine.", Win32::OLE-> LastError; $serverConn = $locator-> ConnectServer($server, "root/CIMV2", $username, $password) or die "Can't access WMI on remote machine $server: ", Win32::OLE-> LastError; $colItems = $serverConn-> Get( "Win32_Processor" ) || die "Error: ".Win32::OLE-> LastError(); print "LoadPercentage: ". $colItems->{LoadPercentage} ."\n"; It just returns "Load Percentage: " Any idea at all?
(This post was edited by jhyland87 on Mar 16, 2010, 5:07 PM)
|