First time posting so I hope I'm doing it right.
I've created a script to report the size of individual sessions (full, inc,...) of individual VM's. I've been able to get the data for the Backup and Replication job types using the ReportSessionsView in the Veeam DB and then getting the data for the individual VM's from the ReportSessionInfoView. The data for the individual VM's for the BackupSync sessions is also visible but the session_id in those rows does not correspond to any session id in ReportSessionsView. The BackupSync jobs are simply not registered in the ReportSessionsView. Where (in the Veeam DB) is the BackupSync session data registered?
To give an idea of what I'm doing, here a piece of the script:
Code: Select all
# Query the Veeam DB for all succesfull job sessions ([result] = '0')
$SQLQuerySession = "SELECT [id],[creation_time],[end_time],[result],[total_size],[stored_size] `
FROM [VeeamBackup].[dbo].[ReportSessionsView] `
WHERE [job_name] = '" + $VeeamJob.Name + "' and [result] = '0' `
ORDER BY [creation_time] asc;"
$VeeamSessions = Invoke-Sqlcmd -Query $SQLQuerySession -ServerInstance "<DB Instance>"
# Retrieve the VM information for each session
ForEach ($VeeamSessionID in $VeeamSessions.ID)
{
$SQLQueryInfo = "SELECT [id],[creation_time],[object_name],[total_size],[stored_size] `
FROM [VeeamBackup].[dbo].[ReportSessionInfoView] `
WHERE [session_id] = '" + $VeeamSessionID + "';" $VeeamSessionInfo = Invoke-Sqlcmd -Query $SQLQueryInfo -ServerInstance "<DB Instance>"
# Put the data per VM in the output object but only the data of which restore points are still available
ForEach ($VeeamVMInfo in $VeeamSessionInfo)
Peter