Veeam Endpoint Backup FREE уведомления на почту
Veeam Endpoint Backup FREE уведомления на email - как сделать?
Ни для кого не секрет, что есть такой замечательный продукт который дается ну совсем бесплатно. Но как говориться бесплатно, но есть одна небольшая засада, эта софтина не умеет кидать алерты о своих действиях. Побродив по интернету наткнулся на форум veeam где эту проблему решили скриптом на PowelShell (вот тут forums.veeam.com/veeam-endpoint-backup-f33/here-it-is-powershell-script-to-add-veb-emails-t27569.html на форум). На всякий случай приведу листинг скрипта сюда для истории:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
########################################################### # Edit this part: $youremailserver= "YourServerName" $sender = "YourSenderAddress" $recipient = "YourRecipient" ########################################################### # Put most info into the body of the email: $TimeGenerated = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property TimeGenerated | out-string $Source = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Source | out-string $EntryType = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property EntryType | out-string $Message = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Message | out-string $InstanceID = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property InstanceID| out-string $Body = " $TimeGenerated Instance-ID: $InstanceID $Message " # Determine the subject according to the result of the backup: if ($Message.contains("Success")) { $subject = "EndpointBackup finished with Success." } elseif ($InstanceID.contains("110")) { $subject = "EndpointBackup started." } else { $subject = "EndpointBackup finished but NO SUCCESS!! Check Body for details." } # Send the email using the powershell object (replace with e.g. blat.exe for older powershell-Versions) if ($InstanceID.contains("110") -Or $InstanceID.contains("190")) { Send-MailMessage -To $recipient -Subject $subject -From $sender -Body $body -SmtpServer $Youremailserver } else { write-host "I don't want messages on 10010 and 10050 Restorepoint-creation or -remove Emails, skip those" } write-host "Script finished with -$instanceID- as the last event-ID" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
########################################################### # Данные для отправки почты: $From = "почта от кого" $To = "почта кому" $SMTPServer = "смтп сервер" $SMTPPort = "587" $Username = "логин почты" $Password = "пароль почты" ########################################################### # Put most info into the body of the email: $TimeGenerated = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property TimeGenerated | out-string $Source = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Source | out-string $EntryType = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property EntryType | out-string $Message = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Message | out-string $InstanceID = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property InstanceID| out-string $Body = " $TimeGenerated Instance-ID: $InstanceID $Message " # Determine the subject according to the result of the backup: if ($Message.contains("Success")) { $subject = "EndpointBackup finished with Success." } elseif ($InstanceID.contains("110")) { $subject = "EndpointBackup started." } else { $subject = "EndpointBackup finished but NO SUCCESS!! Check Body for details." } # Send the email using the powershell object (replace with e.g. blat.exe for older powershell-Versions) if ($InstanceID.contains("110") -Or $InstanceID.contains("190")) { $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort); $smtp.EnableSSL = $true $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password); $smtp.Send($From, $To, $subject, $body); } else { write-host "I don't want messages on 10010 and 10050 Restorepoint-creation or -remove Emails, skip those" } write-host "Script finished with -$instanceID- as the last event-ID" |
Свежие комментарии