Standalone backup agent for Microsoft Windows servers and workstations (formerly Veeam Endpoint Backup FREE)
Post Reply
larryg
Influencer
Posts: 23
Liked: 3 times
Joined: Aug 10, 2016 1:11 pm
Contact:

feature request - secondary service for email alerts

Post by larryg » 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.
Dima P.
Product Manager
Posts: 14720
Liked: 1705 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: feature request - secondary service for email alerts

Post by Dima P. »

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.
larryg
Influencer
Posts: 23
Liked: 3 times
Joined: Aug 10, 2016 1:11 pm
Contact:

Re: feature request - secondary service for email alerts

Post by larryg »

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.
albertwt
Veteran
Posts: 941
Liked: 53 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: feature request - secondary service for email alerts

Post by albertwt »

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 ! */
larryg
Influencer
Posts: 23
Liked: 3 times
Joined: Aug 10, 2016 1:11 pm
Contact:

Re: feature request - secondary service for email alerts

Post by larryg »

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.
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: feature request - secondary service for email alerts

Post by Vitaliy S. »

Larry, can you please open a case so that we could review the behavior you currently see?
patrickl78
Service Provider
Posts: 32
Liked: 7 times
Joined: Jan 09, 2014 11:16 pm
Full Name: Patrick Leonard
Contact:

Re: feature request - secondary service for email alerts

Post by patrickl78 »

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
larryg
Influencer
Posts: 23
Liked: 3 times
Joined: Aug 10, 2016 1:11 pm
Contact:

Re: feature request - secondary service for email alerts

Post by larryg » 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
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests