The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Wanted - xAP UPS Monitor


  • Subject: Re: Wanted - xAP UPS Monitor
  • From: Simon Haslam <simon_haslam@xxxxxxxxxxx>
  • Date: Wed, 27 Oct 2010 17:37:45 +0100 (BST)

--0-1167412274-1288197465=:65147
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

You might find there's already utility that does this. IIRC PowerChute is
t=
he APC software that runs on the PC, but maybe there's some way that can
br=
oadcast the shutdown message already. Or maybe there's already some open
so=
urce software that does this - it must be quite a common requirement, e.g.
=
for a UPS protecting a whole set of servers.

(not xAP I know but presumably it is the functionality, rather than
impleme=
ntation, that is important)


Simon

--- On Wed, 27/10/10, Neil Wrightson <neilw@xxxxxxx> wrote:

From: Neil Wrightson <neilw@xxxxxxx>
Subject: [xap_automation] Wanted - xAP UPS Monitor
To: xap_automation@xxxxxxx
Cc: nwemail@xxxxxxx
Date: Wednesday, 27 October, 2010, 3:49







=C2=A0



=20=20


=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20


Hi=20
All,
=C2=A0
Does a xAP UPS=20
monitor exist at all?
=C2=A0
I have a few UPS's=20
(APC SmartUPS) and some that are powering multiple PC's.
None of the UPS's=20
have a network interface, only serial interfaces.=20
I connect the=20
serial(or USB) interface to one of the PC's and this looks after (shuts
dow=
n=20
etc) this PC but the other PC on the same UPS has the equivalent of the
PLU=
G=20
being ripped out, when ultimately the batteries have gone flat. That is,
it=
is=20
not shut down in a normal manner.
So an xAP server app=20
that monitored the UPS connected to it's PC and did appropriate broadcasts
=
and a=20
client xAP app on other PC's could monitor these messages and do
appropriat=
e=20
things.
=C2=A0
Does anything like=20
this exist?
=C2=A0
=C2=A0
I found this code in=20
a Google=C2=A0search but do not know any VB programming.
=C2=A0
=C2=A0
'***********************************************************************
'=20
-- VBScript Source File=20
' -- NAME: UPS Check
' -- AUTHOR: Dan
' --=20
DATE=C2=A0 : 6/23/2007
' -- VERSION: 1.0
' -- COMMENTS: Uses WMI to poll=20
UPS. Returns Null if no UPS attached.=20

'=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=20
This example shows all Win32 UPS=20
Objects
'***********************************************************************
On=20
Error Resume Next
Dim strComputer
Dim objWMIService
Dim=20
propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim=20
Password
Dim colItems
strComputer =3D "."
UserName =3D ""
Password =3D=20
""
Set SWBemlocator =3D CreateObject("WbemScripting.SWbemLocator")
Set=20
objWMIService =3D=20
SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set=20
colItems =3D objWMIService.ExecQuery("Select * from=20
Win32_UninterruptiblePowerSupply",,48)
For Each objItem in colItems
=20
WScript.Echo "ActiveInputVoltage: " &
objItem.ActiveInputVoltage
=20
WScript.Echo "Availability: " & objItem.Availability
WScript.Echo=20
"BatteryInstalled: " & objItem.BatteryInstalled
WScript.Echo=20
"CanTurnOffRemotely: " & objItem.CanTurnOffRemotely
WScript.Echo=20
"Caption: " & objItem.Caption
WScript.Echo "CommandFile: " &=20
objItem.CommandFile
WScript.Echo "ConfigManagerErrorCode: " &=20
objItem.ConfigManagerErrorCode
WScript.Echo "ConfigManagerUserConfig: "=20
& objItem.ConfigManagerUserConfig
WScript.Echo "CreationClassName: "=20
& objItem.CreationClassName
WScript.Echo "Description: " &=20
objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
=20
WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
WScript.Echo=20
"ErrorDescription: " & objItem.ErrorDescription
WScript.Echo=20
"EstimatedChargeRemaining: " &
objItem.EstimatedChargeRemaining
=20
WScript.Echo "EstimatedRunTime: " & objItem.EstimatedRunTime
=20
WScript.Echo "FirstMessageDelay: " &
objItem.FirstMessageDelay
=20
WScript.Echo "InstallDate: " & objItem.InstallDate
WScript.Echo=20
"IsSwitchingSupply: " & objItem.IsSwitchingSupply
WScript.Echo=20
"LastErrorCode: " & objItem.LastErrorCode
WScript.Echo=20
"LowBatterySignal: " & objItem.LowBatterySignal
WScript.Echo=20
"MessageInterval: " & objItem.MessageInterval
WScript.Echo "Name: "=20
& objItem.Name
WScript.Echo "PNPDeviceID: " &=20
objItem.PNPDeviceID
WScript.Echo "PowerFailSignal: " &=20
objItem.PowerFailSignal
for each propValue in=20
objItem.PowerManagementCapabilities
=C2=A0 WScript.Echo=20
"PowerManagementCapabilities: " & propValue
Next
WScript.Echo=20
"PowerManagementSupported: " &
objItem.PowerManagementSupported
=20
WScript.Echo "Range1InputFrequencyHigh: " &=20
objItem.Range1InputFrequencyHigh
WScript.Echo "Range1InputFrequencyLow: "=20
& objItem.Range1InputFrequencyLow
WScript.Echo "Range1InputVoltageHigh:=20
" & objItem.Range1InputVoltageHigh
WScript.Echo "Range1InputVoltageLow:=20
" & objItem.Range1InputVoltageLow
WScript.Echo=20
"Range2InputFrequencyHigh: " &
objItem.Range2InputFrequencyHigh
=20
WScript.Echo "Range2InputFrequencyLow: " &=20
objItem.Range2InputFrequencyLow
WScript.Echo "Range2InputVoltageHigh: "=20
& objItem.Range2InputVoltageHigh
WScript.Echo "Range2InputVoltageLow: "=20
& objItem.Range2InputVoltageLow
WScript.Echo "RemainingCapacityStatus: "=20
& objItem.RemainingCapacityStatus
WScript.Echo "Status: " &=20
objItem.Status
WScript.Echo "StatusInfo: " & objItem.StatusInfo
=20
WScript.Echo "SystemCreationClassName: " &=20
objItem.SystemCreationClassName
WScript.Echo "SystemName: " &=20
objItem.SystemName
WScript.Echo "TimeOnBackup: " &=20
objItem.TimeOnBackup
WScript.Echo "TotalOutputPower: " &=20
objItem.TotalOutputPower
WScript.Echo "TypeOfRangeSwitching: " &=20
objItem.TypeOfRangeSwitching
WScript.Echo "UPSPort: " &=20
objItem.UPSPort
Next

Regards,=20
Neil Wrightson.=20



=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20


=20



=20=20






=20=20=20=20=20=20
--0-1167412274-1288197465=:65147
Content-Type: text/html; charset=UTF-8
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>
<html>
<head>
<style type="text/css">
<!--
#ygrp-mkp {
border: 1px solid #d8d8d8;
font-family: Arial;
margin: 10px 0;
padding: 0 10px;
}

#ygrp-mkp hr {
border: 1px solid #d8d8d8;
}

#ygrp-mkp #hd {
color: #628c2a;
font-size: 85%;
font-weight: 700;
line-height: 122%;
margin: 10px 0;
}

#ygrp-mkp #ads {
margin-bottom: 10px;
}

#ygrp-mkp .ad {
padding: 0 0;
}

#ygrp-mkp .ad p {
margin: 0;
}

#ygrp-mkp .ad a {
color: #0000ff;
text-decoration: none;
}
-->
</style>
</head>
<body>



<!-- **begin egp html banner** -->

<br><br>

<!-- **end egp html banner** -->


<table cellspacing="0" cellpadding="0"
border="0" ><tr><td valign="top"
style="font: inherit;">You might find there's already utility
that does this. IIRC PowerChute is the APC software that runs on the PC,
but maybe there's some way that can broadcast the shutdown message already.
Or maybe there's already some open source software that does this - it must
be quite a common requirement, e.g. for a UPS protecting a whole set of
servers.<br><br>(not xAP I know but presumably it is the
functionality, rather than implementation, that is
important)<br><br><br>Simon<br><br>--- On
<b>Wed, 27/10/10, Neil Wrightson
<i>&lt;neilw@xxxxxxx&gt;</i></b>
wrote:<br><blockquote style="border-left: 2px solid rgb(16,
16, 255); margin-left: 5px; padding-left: 5px;"><br>From:
Neil Wrightson &lt;neilw@xxxxxxx&gt;<br>Subject:
[xap_automation] Wanted -
xAP UPS Monitor<br>To: xap_automation@xxxxxxx<br>Cc:
nwemail@xxxxxxx<br>Date: Wednesday, 27 October, 2010,
3:49<br><br><div id="yiv1651865909">





<span style="display: none;">&nbsp;</span>



<div id="yiv1651865909ygrp-text">


<p>


</p><div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">Hi
All,</font></span></div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">Does a xAP UPS
monitor exist at all?</font></span></div>
<div><font face="Arial"
size="2"></font>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">I have a few UPS's
(APC SmartUPS) and some that are powering multiple
PC's.</font></span></div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">None of the UPS's
have a network interface, only serial interfaces.
</font></span></div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">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="yiv1651865909125203902-27102010"><font
face="Arial" size="2">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="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">Does anything like
this exist?</font></span></div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial" size="2">I found this code in
a Google&nbsp;search but do not know any VB
programming.</font></span></div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010"><font
face="Arial"
size="2"></font></span>&nbsp;</div>
<div><span
class="yiv1651865909125203902-27102010">'***********************************************************************<br>'
-- VBScript Source File <br>' -- NAME: UPS Check<br>' --
AUTHOR: Dan<br>' --
DATE&nbsp; : 6/23/2007<br>' -- VERSION: 1.0<br>' --
COMMENTS: Uses WMI to poll
UPS. Returns Null if no UPS attached.
<br>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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: " &amp;
objItem.ActiveInputVoltage<br>
WScript.Echo "Availability: " &amp;
objItem.Availability<br> WScript.Echo
"BatteryInstalled: " &amp; objItem.BatteryInstalled<br>
WScript.Echo
"CanTurnOffRemotely: " &amp;
objItem.CanTurnOffRemotely<br> WScript.Echo
"Caption: " &amp; objItem.Caption<br> WScript.Echo
"CommandFile: " &amp;
objItem.CommandFile<br> WScript.Echo "ConfigManagerErrorCode:
" &amp;
objItem.ConfigManagerErrorCode<br> WScript.Echo
"ConfigManagerUserConfig: "
&amp; objItem.ConfigManagerUserConfig<br> WScript.Echo
"CreationClassName: "
&amp; objItem.CreationClassName<br> WScript.Echo
"Description: " &amp;
objItem.Description<br> WScript.Echo "DeviceID: " &amp;
objItem.DeviceID<br>
WScript.Echo "ErrorCleared: " &amp;
objItem.ErrorCleared<br> WScript.Echo
"ErrorDescription: " &amp; objItem.ErrorDescription<br>
WScript.Echo
"EstimatedChargeRemaining: " &amp;
objItem.EstimatedChargeRemaining<br>
WScript.Echo "EstimatedRunTime: " &amp;
objItem.EstimatedRunTime<br>
WScript.Echo "FirstMessageDelay: " &amp;
objItem.FirstMessageDelay<br>
WScript.Echo "InstallDate: " &amp;
objItem.InstallDate<br> WScript.Echo
"IsSwitchingSupply: " &amp;
objItem.IsSwitchingSupply<br> WScript.Echo
"LastErrorCode: " &amp; objItem.LastErrorCode<br>
WScript.Echo
"LowBatterySignal: " &amp; objItem.LowBatterySignal<br>
WScript.Echo
"MessageInterval: " &amp; objItem.MessageInterval<br>
WScript.Echo "Name: "
&amp; objItem.Name<br> WScript.Echo "PNPDeviceID: "
&amp;
objItem.PNPDeviceID<br> WScript.Echo "PowerFailSignal: "
&amp;
objItem.PowerFailSignal<br> for each propValue in
objItem.PowerManagementCapabilities<br>&nbsp; WScript.Echo
"PowerManagementCapabilities: " &amp; propValue<br>
Next<br> WScript.Echo
"PowerManagementSupported: " &amp;
objItem.PowerManagementSupported<br>
WScript.Echo "Range1InputFrequencyHigh: " &amp;
objItem.Range1InputFrequencyHigh<br> WScript.Echo
"Range1InputFrequencyLow: "
&amp; objItem.Range1InputFrequencyLow<br> WScript.Echo
"Range1InputVoltageHigh:
" &amp; objItem.Range1InputVoltageHigh<br> WScript.Echo
"Range1InputVoltageLow:
" &amp; objItem.Range1InputVoltageLow<br> WScript.Echo
"Range2InputFrequencyHigh: " &amp;
objItem.Range2InputFrequencyHigh<br>
WScript.Echo "Range2InputFrequencyLow: " &amp;
objItem.Range2InputFrequencyLow<br> WScript.Echo
"Range2InputVoltageHigh: "
&amp; objItem.Range2InputVoltageHigh<br> WScript.Echo
"Range2InputVoltageLow: "
&amp; objItem.Range2InputVoltageLow<br> WScript.Echo
"RemainingCapacityStatus: "
&amp; objItem.RemainingCapacityStatus<br> WScript.Echo
"Status: " &amp;
objItem.Status<br> WScript.Echo "StatusInfo: " &amp;
objItem.StatusInfo<br>
WScript.Echo "SystemCreationClassName: " &amp;
objItem.SystemCreationClassName<br> WScript.Echo "SystemName:
" &amp;
objItem.SystemName<br> WScript.Echo "TimeOnBackup: "
&amp;
objItem.TimeOnBackup<br> WScript.Echo "TotalOutputPower: "
&amp;
objItem.TotalOutputPower<br> WScript.Echo "TypeOfRangeSwitching:
" &amp;
objItem.TypeOfRangeSwitching<br> WScript.Echo "UPSPort: "
&amp;
objItem.UPSPort<br>Next</span></div>
<div class="yiv1651865909Section1">
<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>


</div>







</div></blockquote></td></tr></table><br>







<!-- **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=4705/stime=1288221147";
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=X3oDMTJmOWJqaDF1BF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyODgyMjExNDc-";>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=X3oDMTJkOWprbDE5BF9TAzk3NDc2NTkwBGdycElkAzk2NzQzNDMEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjg4MjIxMTQ3";>
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>

--0-1167412274-1288197465=:65147--

xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.