Friday, November 3, 2006

xAP Ping script

I use xAP Ping to monitor my servers. I also have it monitor my network enabled amp. Since the amp sits in a closed cabinet, it can build up heat while it's running. To help with ventilation, I put a PC case fan into the cabinet and have that turn on when the amp is powered on. This amp doesn't have switched outlets on it, so I can't rely on that to power up the fan.

' pingamp.txt
Sub Main()
ping=xap.getfromraw(rawmessage, "ping.results,ping_amp")
if GetGlobal("PingAmp") <> "Fail" and ping = "Fail" then
' this is my starCOM task to turn on X10 devices
ExecuteX10Appl "AmpFan",0
SetGlobal "PingAmp", ping
elseif GetGlobal("PingAmp") <> "Success" and ping = "Success" then
ExecuteX10Appl "AmpFan",1
SetGlobal "PingAmp", ping
end if
End Sub

Create a Floorplan raw device for Ping:
  • alias = Amp
  • source =
  • class = ping.status
  • section = ping.results
  • item = ping_amp
  • script to run on update = pingamp

Don't forget to create a device called ping_amp in xAP Ping.

No comments:

Post a Comment