Getting all Atera agents reporting a specific alert
So due to a recent Atera bug, it seems like a lot of my servers are alerting availability issues, but every time I try to figure it out, the servers are running totally fine. According to Atera the issue appears to be caused by a bad update to the agent program. Atera support had told one user that reinstalling the agent may solve the issue while they are working on a better resolution to apply globally.
So time to figure out which servers are potentially problematic. Time to break out PSAtera. With servers alerting almost constantly right now due to the bug, it's hard to figure out which ones are actually having an issue. Using a little PSAtera and PowerShell magic, we can quickly get a list of the servers posting availability alerts:
$devices = Get-AteraAlerts -Open -Snoozed -Resolved | `
Where-Object {
$_.Created -gt (Get-Date).AddDays(-7) -and ` # I don't know when the issue started, but it's only been apparent in the last 7 days
$_.Title -eq "Machine status unknown" # The title of alerts for device agents (instead of including other devices like SNMP and Generic)
} | `
Group-Object DeviceName,DeviceGuid | `
Sort-Object Count -Descending
$devices
There we have it, the output will include the device name and GUID, along with a count of the alerts. You can probably just look at the outliers, the ones with far more alerts than the others.
Now lets add one more little bit to get a cleaner output:
$devices | ForEach-Object {
[PSCustomObject]@{
Name=$_.Name.Split(", ")[0]
Alerts=$_.Count
Link="https://app.atera.com/Admin#/rmm/device/$($_.Name.Split(", ")[1])/agent"
}
}
Now the output will just be a list of devices, how many times they've alerted in the past 7 days and a link directly to the device. In the Script Library there is a script named "AteraSupportReinstallAgentWithSameID" that you can run on the devices to reinstall the Atera Agent.