Skip to content

Instantly share code, notes, and snippets.

@theinventor
Created December 1, 2017 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theinventor/9fca7fe0d9d6a43b21b1fcfe25d50fac to your computer and use it in GitHub Desktop.
Save theinventor/9fca7fe0d9d6a43b21b1fcfe25d50fac to your computer and use it in GitHub Desktop.
Sample powershell for Syncro to get event viewer data (for last 1 day, so make this a daily script) and create an alert in your Syncro account if it finds issues.
Import-Module $env:SyncroModule
# Create RMMAlerts when a backup fails
$event = Get-EventLog "Veeam Backup" -newest 1 -After (Get-Date).AddDays(-1)| Where-Object {$_.EventID -eq 0}
if($event.entrytype -eq "Error") {
write-host "We got an event that is an error from Veeam Backup!"
Rmm-Alert -Category "veeam_backup_failed" -Body "Veeam Backup Failed on $(%computername%) - message: $($event.message)"
} else {
write-host "No errors here"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment