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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



jhyland87
Novice

Mar 16, 2010, 5:07 PM


Views: 5398
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


Quote
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)


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