The script doesn’t show the last contact, it shows when was a discrepancy between a total amount of audits and answered audits.
To see when was the last audit you need to request a full history without a filter, i.e.
PowerShell
foreach ($item in ((Invoke-WebRequest http://localhost:14002/api/sno).Content | ConvertFrom-Json).satellites.id) {
((Invoke-WebRequest http://localhost:14002/api/sno/satellite/$item).Content | ConvertFrom-Json).auditHistory.windows |
Where-Object{$_.totalCount -ne 0} | ForEach-Object{Write-Host $item; $_ | Format-Table -AutoSize}
}
bash
for item in `curl -sL http://localhost:14002/api/sno | jq '.satellites[].id' -r`; do
curl -s http://localhost:14002/api/sno/satellite/$item | \
jq '{id: .id, auditHistory: [.auditHistory.windows[] | select(.totalCount != 0]}'
done
Please do not post full results
, only when the last window was for each satellite