[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Wanted - xAP UPS Monitor
- Subject: Wanted - xAP UPS Monitor
- From: "Neil Wrightson" <neilw@xxxxxxxxxx>
- Date: Wed, 27 Oct 2010 13:49:24 +1100
------=_NextPart_000_0000_01CB75DD.C55CDA10
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi All,
Does a xAP UPS monitor exist at all?
I have a few UPS's (APC SmartUPS) and some that are powering multiple PC's.
None of the UPS's have a network interface, only serial interfaces.
I connect the serial(or USB) interface to one of the PC's and this looks
after (shuts down etc) this PC but the other PC on the same UPS has the
equivalent of the PLUG being ripped out, when ultimately the batteries have
gone flat. That is, it is not shut down in a normal manner.
So an xAP server app that monitored the UPS connected to it's PC and did
appropriate broadcasts and a client xAP app on other PC's could monitor
these messages and do appropriate things.
Does anything like this exist?
I found this code in a Google search but do not know any VB programming.
'***********************************************************************
' -- 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
Regards,
Neil Wrightson.
------=_NextPart_000_0000_01CB75DD.C55CDA10
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit
<head>
<style type="text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii"
http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML
8.00.6001.18975"></HEAD>
<BODY>
<!-- **begin egp html banner** -->
<br><br>
<!-- **end egp html banner** -->
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Hi
All,</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Does a xAP UPS
monitor exist at all?</FONT></SPAN></DIV>
<DIV><FONT size=2
face=Arial></FONT> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I have a few UPS's
(APC SmartUPS) and some that are powering multiple
PC's.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>None of the UPS's
have a network interface, only serial interfaces.
</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I connect the
serial(or USB) interface to one of the PC's and this looks after (shuts
down
etc) this PC but the other PC on the same UPS has the equivalent of the
PLUG
being ripped out, when ultimately the batteries have gone flat. That is, it
is
not shut down in a normal manner.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>So an xAP server app
that monitored the UPS connected to it's PC and did appropriate broadcasts
and a
client xAP app on other PC's could monitor these messages and do
appropriate
things.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>Does anything like
this exist?</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial>I found this code in
a Google search but do not know any VB
programming.</FONT></SPAN></DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=125203902-27102010><FONT size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN
class=125203902-27102010>'***********************************************************************<BR>'
-- VBScript Source File <BR>' -- NAME: UPS Check<BR>' --
AUTHOR: Dan<BR>' --
DATE : 6/23/2007<BR>' -- VERSION: 1.0<BR>' --
COMMENTS: Uses WMI to poll
UPS. Returns Null if no UPS attached.
<BR>'
This example shows all Win32 UPS
Objects<BR>'***********************************************************************<BR>On
Error Resume Next<BR>Dim strComputer<BR>Dim
objWMIService<BR>Dim
propValue<BR>Dim objItem<BR>Dim SWBemlocator<BR>Dim
UserName<BR>Dim
Password<BR>Dim colItems<BR>strComputer =
"."<BR>UserName = ""<BR>Password =
""<BR>Set SWBemlocator =
CreateObject("WbemScripting.SWbemLocator")<BR>Set
objWMIService =
SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)<BR>Set
colItems = objWMIService.ExecQuery("Select * from
Win32_UninterruptiblePowerSupply",,48)<BR>For Each objItem in
colItems<BR>
WScript.Echo "ActiveInputVoltage: " &
objItem.ActiveInputVoltage<BR>
WScript.Echo "Availability: " &
objItem.Availability<BR> WScript.Echo
"BatteryInstalled: " & objItem.BatteryInstalled<BR>
WScript.Echo
"CanTurnOffRemotely: " &
objItem.CanTurnOffRemotely<BR> WScript.Echo
"Caption: " & objItem.Caption<BR> WScript.Echo
"CommandFile: " &
objItem.CommandFile<BR> WScript.Echo "ConfigManagerErrorCode:
" &
objItem.ConfigManagerErrorCode<BR> WScript.Echo
"ConfigManagerUserConfig: "
& objItem.ConfigManagerUserConfig<BR> WScript.Echo
"CreationClassName: "
& objItem.CreationClassName<BR> WScript.Echo
"Description: " &
objItem.Description<BR> WScript.Echo "DeviceID: " &
objItem.DeviceID<BR>
WScript.Echo "ErrorCleared: " &
objItem.ErrorCleared<BR> WScript.Echo
"ErrorDescription: " & objItem.ErrorDescription<BR>
WScript.Echo
"EstimatedChargeRemaining: " &
objItem.EstimatedChargeRemaining<BR>
WScript.Echo "EstimatedRunTime: " &
objItem.EstimatedRunTime<BR>
WScript.Echo "FirstMessageDelay: " &
objItem.FirstMessageDelay<BR>
WScript.Echo "InstallDate: " &
objItem.InstallDate<BR> WScript.Echo
"IsSwitchingSupply: " &
objItem.IsSwitchingSupply<BR> WScript.Echo
"LastErrorCode: " & objItem.LastErrorCode<BR>
WScript.Echo
"LowBatterySignal: " & objItem.LowBatterySignal<BR>
WScript.Echo
"MessageInterval: " & objItem.MessageInterval<BR>
WScript.Echo "Name: "
& objItem.Name<BR> WScript.Echo "PNPDeviceID: "
&
objItem.PNPDeviceID<BR> WScript.Echo "PowerFailSignal: "
&
objItem.PowerFailSignal<BR> for each propValue in
objItem.PowerManagementCapabilities<BR> WScript.Echo
"PowerManagementCapabilities: " & propValue<BR>
Next<BR> WScript.Echo
"PowerManagementSupported: " &
objItem.PowerManagementSupported<BR>
WScript.Echo "Range1InputFrequencyHigh: " &
objItem.Range1InputFrequencyHigh<BR> WScript.Echo
"Range1InputFrequencyLow: "
& objItem.Range1InputFrequencyLow<BR> WScript.Echo
"Range1InputVoltageHigh:
" & objItem.Range1InputVoltageHigh<BR> WScript.Echo
"Range1InputVoltageLow:
" & objItem.Range1InputVoltageLow<BR> WScript.Echo
"Range2InputFrequencyHigh: " &
objItem.Range2InputFrequencyHigh<BR>
WScript.Echo "Range2InputFrequencyLow: " &
objItem.Range2InputFrequencyLow<BR> WScript.Echo
"Range2InputVoltageHigh: "
& objItem.Range2InputVoltageHigh<BR> WScript.Echo
"Range2InputVoltageLow: "
& objItem.Range2InputVoltageLow<BR> WScript.Echo
"RemainingCapacityStatus: "
& objItem.RemainingCapacityStatus<BR> WScript.Echo
"Status: " &
objItem.Status<BR> WScript.Echo "StatusInfo: " &
objItem.StatusInfo<BR>
WScript.Echo "SystemCreationClassName: " &
objItem.SystemCreationClassName<BR> WScript.Echo "SystemName:
" &
objItem.SystemName<BR> WScript.Echo "TimeOnBackup: "
&
objItem.TimeOnBackup<BR> WScript.Echo "TotalOutputPower: "
&
objItem.TotalOutputPower<BR> WScript.Echo "TypeOfRangeSwitching:
" &
objItem.TypeOfRangeSwitching<BR> WScript.Echo "UPSPort: "
&
objItem.UPSPort<BR>Next</SPAN></DIV>
<DIV class=Section1>
<P><SPAN style="FONT-FAMILY: Arial; FONT-SIZE:
10pt">Regards,</SPAN> </P>
<P><B><SPAN style="FONT-SIZE: 13.5pt">Neil
Wrightson.</SPAN></B>
</P></DIV>
<!-- **begin egp html banner** -->
<br>
<br>
<!-- **end egp html banner** -->
<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- **begin egp html banner** -->
<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9674343/grpspId=1705007709/msgId=4703/stime=1288151469"
width="1" height="1"> <br>
<!-- **end egp html banner** -->
<!-- **begin egp html banner** -->
<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xap_automation/join;_ylc=X3oDMTJmdnQzb2NwBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyODgxNTE0Njk-">Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xap_automation-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a> <a
href = "mailto:xap_automation-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xap_automation;_ylc=X3oDMTJkbmNtZmcyBF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjg4MTUxNDY5">
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/">
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xap_automation-unsubscribe@xxxxxxx?subject=Unsubscribe">
Unsubscribe
</a>
<br>
</div>
<br>
<!-- **end egp html banner** -->
<div style="color: white; clear:
both;"/>__,_._,___</div>
</BODY></HTML>
------=_NextPart_000_0000_01CB75DD.C55CDA10--
xAP_Automation Main Index |
xAP_Automation Thread Index |
xAP_Automation Home |
Archives Home
|