Skip to content

Instantly share code, notes, and snippets.

@joshooaj
joshooaj / Get-DeviceStatusReport.ps1
Created May 23, 2021 18:07
Get current device status for all cameras from all recording servers and produce a table of Recording Servers with the number of cameras having errors
function Get-DeviceStatusReport {
$cameraKind = Get-Kind -List | Where-Object DisplayName -eq 'Camera' | Select-Object -ExpandProperty Kind
$groupedCameras = Get-PlatformItem -Kind $cameraKind | Select-Object @{Name='RecorderId'; Expression={$_.FQID.ServerId.Id}}, @{Name='CameraId'; Expression={$_.FQID.ObjectId}} | Group-Object RecorderId
foreach ($group in $groupedCameras) {
$recorder = Get-RecordingServer -Id $group.Name
try {
$svc = Get-RecorderStatusService2 -RecordingServer $recorder
$cameraStatusArray = $svc.GetCurrentDeviceStatus((Get-Token), $group.Group.CameraId).CameraDeviceStatusArray
[pscustomobject]@{
Recorder = $recorder.Name
@cmer
cmer / haproxy.cfg
Last active December 17, 2024 14:18
Simple, no bullshit TCP port forwarding using HAProxy
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443