romainsi / zabbix-VEEAM_B-R

52 stars 40 forks source link

Discovery of all VMs in Backup Job dosen't work properly. #48

Open usbpc opened 4 years ago

usbpc commented 4 years ago

I have a Backup Job that is Setup to make a Backup of a whole vCenter Cluster and also Exclude one VM within that cluster.

Unfortunately this Script dosen't properly detect any of the VMs that are contained within that Backup Job.

The discovery item key that dosen't work properly is: vbr["DiscoveryBackupVmsByJobs"]

Looking through the Script it seems to be executing something about like this:

[Veeam.Backup.Core.CBackupJob]::GetAll() | Where-Object { $_.LogNameMainPart -eq "Backup Job - NAME"  } | Get-VBRJobObject | ForEach-Object { $_.Object.Type }

and adds it to Zabbix in case that Type is VM it adds it in Zabbix.

There are two problems, but one seems to be a Problem on Veeams side.

  1. The Cluster is Reported with Type "VM" in the place the script looks.
  2. The Excluded VM is added, since it has Type "VM".

The second Problem could be fixed if the script would also Consider:

[Veeam.Backup.Core.CBackupJob]::GetAll() | Where-Object { $_.LogNameMainPart -eq "Backup Job - NAME"  } | Get-VBRJobObject | ForEach-Object { $_.Type }

As the Values there seem to be either "Include" or "Exclude", it should only include VMs that are Included, not any that are Excluded.

usbpc commented 4 years ago

Another thing to maybe consider is using the Information from the "backuptaskwithretry.xml" as there all VMs that are backed up seem to be listed.

This might solve the Problem where there aren't any of the right VMs listed for my Backup job.