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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help: Win32_Processor and remote Load Percentage?: Edit Log


Mar 16, 2010, 5:07 PM

Views: 6203
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 = "";
$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)

Edit Log:
Post edited by jhyland87 (Novice) on Mar 16, 2010, 5:07 PM

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

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