feature request - secondary service for email alerts

Backup agent for Microsoft Windows servers and workstations (formerly Veeam Endpoint Backup FREE)

feature request - secondary service for email alerts

Veeam Logoby larryg » Wed Aug 10, 2016 3:53 pm 1 person likes this post

The free endpoint backup is nice, but I've run into a major flaw with alerts. The backup service runs the backups and also runs the email alerts. If the service hangs (which has happened to me a few times now) the backups fail, causing a small change in the tray icon. But the emails just stop, because they depend on that service that's hung up.

Instead of getting an email telling me the back failed, I get nothing. Unless I happen to notice that I didn't get an email the only way of knowing something is wrong is if the user happens to notice the little X on the icon in the tray, showing an error.

It would be really nice if the email alert service was separate so it could keep working when backups fail.
larryg
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Aug 10, 2016 1:11 pm

Re: feature request - secondary service for email alerts

Veeam Logoby Dima P. » Wed Aug 10, 2016 5:30 pm

Hello larryg,

Thanks for sharing your request. I wonder if it’s possible to set such type of notifications via Windows Task Scheduler and trigger it according to Veeam Endpoint Backup service state.
Dima P.
Veeam Software
 
Posts: 6263
Liked: 441 times
Joined: Mon Feb 04, 2013 2:07 pm
Location: SPb
Full Name: Dmitry Popov

Re: feature request - secondary service for email alerts

Veeam Logoby larryg » Mon Aug 15, 2016 12:48 pm

The service state is running, as it should be. So that wouldn't work, no. Something needs to actually try to communicate with it, which will time out, and then send an alert.
larryg
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Aug 10, 2016 1:11 pm

Re: feature request - secondary service for email alerts

Veeam Logoby albertwt » Mon Aug 22, 2016 11:21 pm

You can try to save this Batch script and execute it according to your suitable interval.

Code: Select all
@PowerShell.exe -Command "Invoke-Expression -Command ((Get-Content -Path '%~f0' | Select-Object -Skip 2) -join [environment]::NewLine)"
@exit /b %Errorlevel%

$ServiceName = 'Name of the service....'
$LogFile = "C:\Temp\$($ServiceName).log"
$TimeoutStart = 120            ## Seconds
$WaitIfPending = 120            ## Seconds
$WaitBeforeVerification = 10    ## Seconds

$Script:LogFileError = $False
Function Write-Log([string]$Text, [string]$Type = 'Info') {
   $Delim = "`t"
   $TimeStamp = "[$(Get-Date -Format "yyyy-MM-dd HH:mm:ss")]"
   Switch ($Type) {
      'Info'      {$ColorType = [ConsoleColor]'White'}
      'Success'   {$ColorType = [ConsoleColor]'Green'}
      'Warning'   {$ColorType = [ConsoleColor]'Yellow'}
      'Error'      {$ColorType = [ConsoleColor]'Red'}
   }
   Try {
      Write-Host -Object $TimeStamp -ForegroundColor Gray -NoNewline -ErrorAction Stop
      Write-Host -Object ($Delim + $Type) -ForegroundColor $ColorType -NoNewline -ErrorAction Stop
      Write-Host -Object ($Delim + $Text) -ForegroundColor White -ErrorAction Stop
   } Catch {}
   If (!$Script:LogFileError -and ![string]::IsNullOrEmpty($LogFile)) {
      Try {
         Out-File -InputObject ($TimeStamp + $Delim + $Type + $Delim + $Text) -FilePath $LogFile -Append -Force -ErrorAction Stop
      } Catch {
         $Script:LogFileError = $True
      }
   }
}

Function Start-ServiceAndVerify([string]$Name, [string]$Action = '') {
   If ($Action -eq 'Retry') {
      Start-Sleep -Seconds $WaitIfPending
   } ElseIf ($Action -eq 'Verify') {
      Start-Sleep -Seconds $WaitBeforeVerification
   }
   Try {
      $ServiceNet = Get-Service -Name $Name -ErrorAction Stop      
      Switch ($ServiceNet.Status) {
         'Running' {
            If ($Action -eq 'Retry') {
               Write-Log -Text "Retried, and service '$($Name)' is now in state '$($_)'; nothing more to do." -Type 'Success'
            } ElseIf ($Action -eq 'Verify') {
               Write-Log -Text "Verified, service '$($Name)' is still in state '$($_)'." -Type 'Success'
            } Else {
               Write-Log -Text "Service '$($Name)' is running, start action wasn't performed." -Type 'Success'
            }
            Return 'OK'
         }
         {'Paused', 'Stopped' -contains $_} {
            If ($Action -eq 'Retry') {
               Write-Log -Text "Retried, and service '$($Name)' is now in state '$($_)'; will attempt to start."
            } ElseIf ($Action -eq 'Verify') {
               Write-Log -Text "Verified, but service '$($Name)' is now in state '$($_)' after having started correctly." -Type 'Error'
               Return 'Error'
            }
            Try {
               If ($_ -eq 'Stopped') {
                  Write-Log -Text "Starting service '$($Name)', timeout is $($TimeoutStart) seconds."
                  $ServiceNet.Start()
               } Else {
                  Write-Log -Text "Continuing service '$($Name)', timeout is $($TimeoutStart) seconds."
                  $ServiceNet.Continue()
               }
               $ServiceNet.WaitForStatus('Running', [Timespan]::FromSeconds($TimeoutStart))
               Write-Log -Text "Service '$($Name)' started successfully; will verify in $($WaitBeforeVerification) seconds."
               Return 'Verify'
            } Catch {
               Write-Log "Service '$($ServiceName)' not started after $($TimeoutStart) seconds." -Type 'Error'
               Return 'Error'
            }
         }
         Default {   ## Pending
            If ($Action -eq 'Retry') {
               Write-Log -Text "Retried, but service '$($Name)' is currently in state '$($_)'." -Type 'Error'
               Return 'Error'
            } ElseIf ($Action -eq 'Verify') {
               Write-Log -Text "Verified, but service '$($Name)' is now in state '$($_)' after having started correctly." -Type 'Error'
               Return 'Error'
            }
            Write-Log -Text "Service '$($Name)' is currently in state '$($_)', will retry in $($WaitIfPending) seconds." -Type 'Warning'
            Return 'Retry'
         }
      }
   } Catch {
      Write-Log -Text "Service '$($Name)' not found: $($_.Exception.Message)" -Type 'Error'
      Return 'Error'
   }
}

$Result = ''
Do {
   $Result = Start-ServiceAndVerify -Name $ServiceName -Action $Result
} Until ('OK', 'Error' -contains $Result)

If ($Result -eq 'Error') {
   Exit 2
} ElseIf ($Script:LogFileError) {
   Exit 1
}
Exit 0


it is Powershell wrapped by Batch script :mrgreen:
--
/* Veeam software enthusiast user & supporter ! */
albertwt
Expert
 
Posts: 607
Liked: 19 times
Joined: Thu Nov 05, 2009 12:24 pm
Location: Sydney, NSW

Re: feature request - secondary service for email alerts

Veeam Logoby larryg » Tue Aug 23, 2016 4:29 pm

Unfortunately I have discovered that simply restarting the Veeam service does not fix the backup. I'm not sure what else is going on with it, but a reboot gets it going again. It will work for several days then just stop - no emails about it failing, but no backups.
larryg
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Aug 10, 2016 1:11 pm

Re: feature request - secondary service for email alerts

Veeam Logoby Vitaliy S. » Tue Aug 23, 2016 4:57 pm

Larry, can you please open a case so that we could review the behavior you currently see?
Vitaliy S.
Veeam Software
 
Posts: 19575
Liked: 1106 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: feature request - secondary service for email alerts

Veeam Logoby patrickl78 » Tue Aug 23, 2016 7:33 pm

Hi Larry this is one of the biggest flaws in checking backups via email. We actually built a product that takes inbound emails and put them in a visual dashboard, audit page and reporting system. Feel free to check it out at http://www.backupradar.com. Dima has reviewed it as well and we worked with him on creating support for all Veeam reports. Our system reports a failure if the report is not sent so you know that something is wrong with the backup. That said it's still obviously a good idea to run down the support issue side of it as well with Veeam.

Thanks,
Patrick
patrickl78
Enthusiast
 
Posts: 27
Liked: 7 times
Joined: Thu Jan 09, 2014 11:16 pm
Full Name: Patrick Leonard

Re: feature request - secondary service for email alerts

Veeam Logoby larryg » Wed Aug 24, 2016 12:49 pm 1 person likes this post

Vitaliy S. wrote:Larry, can you please open a case so that we could review the behavior you currently see?


Done. Case # 01887791
larryg
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Aug 10, 2016 1:11 pm


Return to Veeam Agent for Windows



Who is online

Users browsing this forum: No registered users and 10 guests