Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 10152

Veeam Backup & Replication • Re: Multiple questions after upgrade to V12

$
0
0
Maybe this is helping somebody, because there is no way to start Healthchecks manually yet:

This is setting the time of the Healthcheck of a Veeam Agent Backup to 1 minute after now, waits for the job to finish and disables the Healthcheck after that.

Code:

 # Veeam Physical Machine HV01 Healthcheck    # Get Job    $job = Get-VBRComputerBackupJob -Name "HV-HV01-NAS01"    # Get Time + 1 Minute    $newCheckTime = (Get-Date).AddMinutes(1)    # Create Healthcheck-Options    $healthCheckOptions = New-VBRHealthCheckOptions -Enable -ScheduleType Weekly -DayOfWeek Sunday -DayNumber 1 -SelectedDays 0,1,2,3,4,5,6 -WeeklyPeriod ([TimeSpan]::Parse($newCheckTime.ToString("HH:mm:ss")))    # Set Healthcheck-Options    Set-VBRComputerBackupJob -Job $job -HealthCheckOptions $healthCheckOptions    Start-Sleep -Seconds 300    do {        Start-Sleep -Seconds 60        # Get last Healtcheck-Session        $lastSession = Get-VBRSession -Type HealthCheck | Sort-Object -Property CreationTime -Descending | Select-Object -First 1        $lastSessionState = $lastSession.State        # Check state of last Healtcheck-Session        if ($lastSessionState -eq 'Working') {            Write-Host ("Healthcheck runnning.")            Write-Host ("Starttime:" + $lastSession.CreationTime)        } else {            Write-Host ("No Healthcheck running.")            Write-Host ("Starttime:" + $lastSession.CreationTime)            Write-Host ("Endtime:" + $lastSession.EndTime)        }    } while ($lastSessionState -eq 'Working')    # Create Healthcheck-Options    $healthCheckOptions = New-VBRHealthCheckOptions -Enable:$false -EnableFullHealthCheck:$false -ScheduleType Weekly    # Set Healthcheck-Options    Set-VBRComputerBackupJob -Job $job -HealthCheckOptions $healthCheckOptions    

This is setting the time of the Healthcheck of a Veeam HyperV Backup to 1 minute after now, waits for the job to finish and disables the Healthcheck after that.

Code:

 # Veeam Virtual Machines HV01 Healthcheck    # Get Job    $job = Get-VBRJob -Name "VM-HV01-NAS01"    # Get Options    $jobOptions = Get-VBRJobOptions -Job $job    # Get Time + 1 Minute    $newCheckTime = (Get-Date).AddMinutes(1)    # Set RecheckTime    $jobOptions.GenerationPolicy.RecheckTime = [TimeSpan]::Parse($newCheckTime.ToString("HH:mm:ss"))        # Enable Healthcheck    $jobOptions.GenerationPolicy.EnableRechek = $true        # Set Options    Set-VBRJobOptions -Job $job -Options $jobOptions    Start-Sleep -Seconds 300    do {        Start-Sleep -Seconds 60        # Get last Healtcheck-Session        $lastSession = Get-VBRSession -Type HealthCheck | Sort-Object -Property CreationTime -Descending | Select-Object -First 1        $lastSessionState = $lastSession.State        # Check state of last Healtcheck-Session        if ($lastSessionState -eq 'Working') {            Write-Host ("Healthcheck runnning.")            Write-Host ("Starttime:" + $lastSession.CreationTime)        } else {            Write-Host ("No Healthcheck running.")            Write-Host ("Starttime:" + $lastSession.CreationTime)            Write-Host ("Endtime:" + $lastSession.EndTime)        }    } while ($lastSessionState -eq 'Working')        # Disable Healthcheck    $jobOptions.GenerationPolicy.EnableRechek = $false    # Set Options    Set-VBRJobOptions -Job $job -Options $jobOptions 
Can't remember if it came with an update, but the results of the healtchecks are coming daily now. I think they are coming from the daily reports in the general options of Veeam.

Statistics: Posted by thatstheplace — Dec 26, 2024 12:58 am



Viewing all articles
Browse latest Browse all 10152

Latest Images

Trending Articles



Latest Images