Hi,
I also wanted a report of just paused sensors. I've written this short VBScript which uses the API to grab them by Device name and then listing each paused Sensor underneath. It could easily be run once a day as a scheduled job and code added to email the results.
You just need to replace SERVERNAME, YOURUSER and YOURPASSHASH with the relevant details (the PassHash for a user can be found on the user accounts page in the web interface).
RL = "http://SERVERNAME/api/table.xml?content=sensortree&username=YOURUSER&passhash=YOURPASSHASH"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set xDoc=CreateObject("Microsoft.XMLDOM")
xDoc.async="false"
If xDoc.load(URL) Then
Set NodeList = xDoc.documentElement.selectNodes("//device [sensor/status='Paused']/name")
TotalCount = 0
For Each Node In NodeList
Set SensorList = xDoc.documentElement.selectNodes("//device [name='" & Node.text & "']/sensor[status='Paused']/name")
sensortext = ""
sensorcount = 0
For Each SensorNode In SensorList
sensorcount = sensorcount + 1
sensortext = sensortext & SensorNode.text & vbCrLf
Next
wscript.echo Node.text & " [" & sensorcount & " paused sensors]" & chr(13)
wscript.echo sensortext & chr(13) & chr(13)
TotalCount = TotalCount + SensorCount
Next
wscript.echo "[Total paused sensors: " & TotalCount & "]"
Else
wscript.echo "XML failed to load from: " & URL
End If
set WshShell = nothing
Add comment