[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

How to get power consumption of My Networks All Computers?


This is real question : i am working a company. There are 200-300 computer in Network. I want to get Power consumption of each by each all computers.

Result must be: :  120 kw/s : 116 kw/s : 123 kw/s

How to do it?
1 Solution
Dave BaldwinFixer of ProblemsCommented:
There is nothing in any of my 25 computers that will give you that thru a program.  You will have to go measure each and every one of them.  Remember to include the monitors for each one.
You would have to have a device to measure power consumption, such as the kill a watt,report in to a server the power usage, and then have it mapped out as to which unit is measuring which computer. Using MAC address would be more effective since that typically does not change, where as IPs frequently can.

However, this will be prohibitively expensive. There are some premade devices, such as the AlertMe, which can do what you want (~$40 per plug, plus the base station), however they're not designed for the scale that you're needing it for. Many people have modified Killawatts to report usage over networks, but that would cost roughly $60 a unit plus your time in doing the needed work. You're basically talking thousands of dollars for the hardware alone.
You can read the WMI information, refer to http://bytes.com/topic/c-sharp/answers/573946-query-power-consumption for sample code in C#. However not every hardware support it. Only high end servers will.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

programmeristAuthor Commented:
Thanks everyBody;

But  i can not  use any device . i want to calculate electiricity or power measuring via ip?  @raysonlee i read it but not working ...
Does your PC support the function? Or there is problem with the sample code?
programmeristAuthor Commented:
How to learn support?
You can run this vbscript in your PC and see whether the results returned properly.
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_CurrentProbe",,48)
For Each objItem in colItems
    Wscript.Echo "Accuracy: " & objItem.Accuracy
    Wscript.Echo "Availability: " & objItem.Availability
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
    Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
    Wscript.Echo "CreationClassName: " & objItem.CreationClassName
    Wscript.Echo "CurrentReading: " & objItem.CurrentReading
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "DeviceID: " & objItem.DeviceID
    Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
    Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "IsLinear: " & objItem.IsLinear
    Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
    Wscript.Echo "LowerThresholdCritical: " & objItem.LowerThresholdCritical
    Wscript.Echo "LowerThresholdFatal: " & objItem.LowerThresholdFatal
    Wscript.Echo "LowerThresholdNonCritical: " & objItem.LowerThresholdNonCritical
    Wscript.Echo "MaxReadable: " & objItem.MaxReadable
    Wscript.Echo "MinReadable: " & objItem.MinReadable
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "NominalReading: " & objItem.NominalReading
    Wscript.Echo "NormalMax: " & objItem.NormalMax
    Wscript.Echo "NormalMin: " & objItem.NormalMin
    Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
    Wscript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
    Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
    Wscript.Echo "Resolution: " & objItem.Resolution
    Wscript.Echo "Status: " & objItem.Status
    Wscript.Echo "StatusInfo: " & objItem.StatusInfo
    Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
    Wscript.Echo "SystemName: " & objItem.SystemName
    Wscript.Echo "Tolerance: " & objItem.Tolerance
    Wscript.Echo "UpperThresholdCritical: " & objItem.UpperThresholdCritical
    Wscript.Echo "UpperThresholdFatal: " & objItem.UpperThresholdFatal
    Wscript.Echo "UpperThresholdNonCritical: " & objItem.UpperThresholdNonCritical

Open in new window

programmeristAuthor Commented:
Ok i want to develop a C#program , is there a simple way? Why below codes returns 0 value?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;
using System.Management.Instrumentation;

[assembly: WmiConfiguration(@"root\cimv2", HostingModel = ManagementHostingModel.LocalSystem)]

namespace VoltageConsumptions
    class Program
        static void Main(string[] args)
                ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"root\cimv2","SELECT * FROM Win32_VoltageProbe");

                foreach (ManagementObject queryObj in searcher.Get())
                    Console.WriteLine("Win32_VoltageProbe instance");
                    Console.WriteLine("CurrentReading: {0}", queryObj["CurrentReading"]);
                    Console.WriteLine("Tolerance: {0}", queryObj["Tolerance"]);

            catch (ManagementException e)


Open in new window

Try use the sample in here http://www.dreamincode.net/forums/topic/42934-using-wmi-class-in-c%23/ to test the standard values. If they are OK, change the parameters to get Voltage and see if the problem is in the code or PC.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now