Announcement

Collapse
No announcement yet.

UPS Monitoring

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • donstephens
    replied
    Thanks, that is a great help.

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Originally posted by donstephens View Post
    Can anyone clue me in to the proper way to find the state of a UPS?
    A WSH or VBS statement?

    Thanks;

    Don
    Code:
    '***********************************************************************
    ' -- VBScript Source File 
    ' -- NAME: UPS Check
    ' -- AUTHOR: Dan
    ' -- DATE  : 6/23/2007
    ' -- VERSION: 1.0
    ' -- COMMENTS: Uses WMI to poll UPS. Returns Null if no UPS attached. 
    '              This example shows all Win32 UPS Objects
    '***********************************************************************
    On Error Resume Next
    Dim strComputer
    Dim objWMIService
    Dim propValue
    Dim objItem
    Dim SWBemlocator
    Dim UserName
    Dim Password
    Dim colItems
    strComputer = "."
    UserName = ""
    Password = ""
    Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
    Set colItems = objWMIService.ExecQuery("Select * from Win32_UninterruptiblePowerSupply",,48)
    For Each objItem in colItems
     WScript.Echo "ActiveInputVoltage: " & objItem.ActiveInputVoltage
     WScript.Echo "Availability: " & objItem.Availability
     WScript.Echo "BatteryInstalled: " & objItem.BatteryInstalled
     WScript.Echo "CanTurnOffRemotely: " & objItem.CanTurnOffRemotely
     WScript.Echo "Caption: " & objItem.Caption
     WScript.Echo "CommandFile: " & objItem.CommandFile
     WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
     WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
     WScript.Echo "CreationClassName: " & objItem.CreationClassName
     WScript.Echo "Description: " & objItem.Description
     WScript.Echo "DeviceID: " & objItem.DeviceID
     WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
     WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
     WScript.Echo "EstimatedChargeRemaining: " & objItem.EstimatedChargeRemaining
     WScript.Echo "EstimatedRunTime: " & objItem.EstimatedRunTime
     WScript.Echo "FirstMessageDelay: " & objItem.FirstMessageDelay
     WScript.Echo "InstallDate: " & objItem.InstallDate
     WScript.Echo "IsSwitchingSupply: " & objItem.IsSwitchingSupply
     WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
     WScript.Echo "LowBatterySignal: " & objItem.LowBatterySignal
     WScript.Echo "MessageInterval: " & objItem.MessageInterval
     WScript.Echo "Name: " & objItem.Name
     WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
     WScript.Echo "PowerFailSignal: " & objItem.PowerFailSignal
     for each propValue in objItem.PowerManagementCapabilities
      WScript.Echo "PowerManagementCapabilities: " & propValue
     Next
     WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
     WScript.Echo "Range1InputFrequencyHigh: " & objItem.Range1InputFrequencyHigh
     WScript.Echo "Range1InputFrequencyLow: " & objItem.Range1InputFrequencyLow
     WScript.Echo "Range1InputVoltageHigh: " & objItem.Range1InputVoltageHigh
     WScript.Echo "Range1InputVoltageLow: " & objItem.Range1InputVoltageLow
     WScript.Echo "Range2InputFrequencyHigh: " & objItem.Range2InputFrequencyHigh
     WScript.Echo "Range2InputFrequencyLow: " & objItem.Range2InputFrequencyLow
     WScript.Echo "Range2InputVoltageHigh: " & objItem.Range2InputVoltageHigh
     WScript.Echo "Range2InputVoltageLow: " & objItem.Range2InputVoltageLow
     WScript.Echo "RemainingCapacityStatus: " & objItem.RemainingCapacityStatus
     WScript.Echo "Status: " & objItem.Status
     WScript.Echo "StatusInfo: " & objItem.StatusInfo
     WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
     WScript.Echo "SystemName: " & objItem.SystemName
     WScript.Echo "TimeOnBackup: " & objItem.TimeOnBackup
     WScript.Echo "TotalOutputPower: " & objItem.TotalOutputPower
     WScript.Echo "TypeOfRangeSwitching: " & objItem.TypeOfRangeSwitching
     WScript.Echo "UPSPort: " & objItem.UPSPort
    Next

    Leave a comment:


  • donstephens
    started a topic UPS Monitoring

    UPS Monitoring

    Can anyone clue me in to the proper way to find the state of a UPS?
    A WSH or VBS statement?

    Thanks;

    Don
Working...
X