lordmilko / PrtgSensors

Miscellaneous sensors for PRTG Network Monitor
MIT License
9 stars 3 forks source link

Backup Copy Job error "Could not find a handler for job type '' #7

Open bash-87 opened 8 months ago

bash-87 commented 8 months ago

I'm using this script to check the status for 2 Backup Jobs and 1 Backup Copy Job running on Veeam 12 Both the Probe and the Backup Server are 2019 in the same domain.

I have no Problem with the backup Jobs and I'm getting the corrct results in PRTG Howerver I can't figure out the Problem with the Backup Copy Job and keep getting the error "Could not find a handler for job type"

1st I thought the Problem is because the Backup Copy Job is set to run after one of the backup Jobs (as new restore Point appears) so I changed the setting and set it to run separately on a different day, but that didn't solve the problem. Any Idea how to solve this?

lordmilko commented 8 months ago

Is that the complete text of the error message?

The error message is supposed to include the name of the job type in it as well

https://github.com/lordmilko/PrtgSensors/blob/d5e1ebfb960cc4bd2fe5b85b4c81490345b3bf75/scripts/Get-VeeamBackupStatus.ps1#L609

If it's not including the job type, this may indicate that the structure of Veeam's objects have changed and that there is no jobType` field anymore. If this is the case, I can't remember whether we're using Veeam 11 or 12 at my workplace, but I'll be back at work in 2 weeks, and can investigate then

bash-87 commented 8 months ago

running the script from cmd using PSx64.exe results in the same error: C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64 -f=Get-VeeamBackupStatus.ps1 -p=backup1.mydomain.local BCJ-DC1 DEBUG: Entered Main DEBUG: Entered [VeeamBackupStatus]::GetStatus DEBUG: Entered [VeeamBackupStatus]::GetStatusInternal DEBUG: -Loading Veeam PSSnapIn DEBUG: -Connecting to Veeam Backup Server DEBUG: Entered [VeeamBackupStatus]::GetBackupsToProcess DEBUG: Entered [VeeamBackupStatus]::GetBackupHandler DEBUG: -Using backup handler [UnknownJobTypeBackupHandler] DEBUG: Entered [UnknownJobTypeHandler]::GetStatus DEBUG: -Testing Backup as Tape Job < Prtg > < Error >1< /Error > < Text >Could not find a handler for job type ''< /Text > < /Prtg >

bash-87 commented 8 months ago

image

Sensor results.

Used Parameter in the sensor: backup1.mydomain.local BCJ-DC1. I'm using the same parameter on the other Backup Jobs (with different Names of the Jobs ofc) and it's working without any issue

bash-87 commented 7 months ago

Hello, I just wanna check if there are any Updates regarding this error

lordmilko commented 7 months ago

I checked and saw we're using Veeam 11 at work, and due to some other things going on don't currently have the bandwidth to upgrade to Veeam 12, ensure everything still works, etc and then investigate this issue. When we do upgrade to Veeam 12 the script will probably break for me and I'll investigate what's up

As noted on the readme

This script can and will break with any given Veeam update

be prepared to get your hands dirty when it breaks.

If you open the script up in the PowerShell ISE, set a breakpoint on line 60 in the Main function and then step in (PowerShell ISE sometimes freaks out when you try and set breakpoints inside classes) you may be able to inspect the $backup variable when you get to line 172, which may provide some clues to whether the JobType property still exists or has been renamed, etc