vMarkusK / Advanced-PRTG-Sensors

Collection of my Advanced PRTG Sensors
https://mycloudrevolution.com/
Apache License 2.0
67 stars 29 forks source link

Hate to sound like an ID10T #55

Closed signalcc closed 4 years ago

signalcc commented 4 years ago

Really hate to seem like I have no clue. But I am new to PRTG and to creating sensors and the such. We use Veeam V10 for our backups and it is pretty critical that we are able to monitor it. I love what this offers, but I cannot find any solid instructions on how to actually set everything up properly. I am on the latest version of PRTG as well.

I have added the PS Script into the EXEXML folder and created the sensor, but then it asks for the parameters and I'm not sure what should be there, I did figure out setting up a Mutex name, but the rest of it has me lost. PSx64 is in the folder as well and if I test the script from my Core server I get an error

The term 'Disconnect-VBRServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

  • CategoryInfo : ObjectNotFound: (Disconnect-VBRServer:String) [PRTG-VeeamBRStats.ps1], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException,PRTG-VeeamBRStats.ps1

I guess I just have no idea how to set this all up. Is there a step by step out there somewhere? I tried but could not find it.

Thanks!

vMarkusK commented 4 years ago

Hello, don't worry. I'll try to figure out what's wrong.

Have you installed the Veeam Console on the PRTG Server (or the Probe you are using)? If so, might you please run these simple commands in the PowerShell Prompt:

Get-PSSnapin -Registered | fl *
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer -Server "<You IP or FQDN>"

If not, please install the Veeam Console on the PRTG Server.

signalcc commented 4 years ago

Ok I have the console installed and after running your command I just have a prompt again. I believe it is connected at this point.

Now I am unsure how to set up the Sensor in PRTG. Sorry for being so needy. We just purchased PRTG 2 weeks ago and I have been deep into it, getting it configured, but the custom sensors are getting me a bit twisted.

Thank you so much for the help!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Thursday, June 25, 2020 3:13 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Hello, don't worry. I'll try to figure out what's wrong.

Have you installed the Veeam Console on the PRTG Server (or the Probe you are using)? If so, might you please run these simple commands in the PowerShell Prompt:

Get-PSSnapin -Registered | fl *

Add-PSSnapin VeeamPSSnapin

Connect-VBRServer -Server ""

If not, please install the Veeam Console on the PRTG Server.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-649766720, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU4ZFBOMLZLRHZIXYSLRYOOU5ANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

Ok I have the console installed and after running your command I just have a prompt again. I believe it is connected at this point.

Sounds great. Might you please run the PS1 file in the PowerShell prompt and share the result?

PRTG-VeeamBRStats.ps1 -Server "<You IP or FQDN>" -Debug

Now I am unsure how to set up the Sensor in PRTG. Sorry for being so needy. We just purchased PRTG 2 weeks ago and I have been deep into it, getting it configured, but the custom sensors are getting me a bit twisted.

Have you already read this Blog Posts? https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/ https://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-manager

signalcc commented 4 years ago

I have tried it every way I could think of and it doesn’t like the command.

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PRTG-VeeamBRStats.ps1 -server 10.10.1.249 -debug PRTG-VeeamBRStats.ps1 : The term 'PRTG-VeeamBRStats.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

Suggestion [3,General]: The command PRTG-VeeamBRStats.ps1 was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\PRTG-VeeamBRStats.ps1". See "get-help about_Command_Precedence" for more details. PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-VeeamBRStats.ps1 -server 10.10.1.249 -debug C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1 : A parameter cannot be found that matches parameter name 'server'. At line:1 char:25

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ".\PRTG-VeeamBRStats.ps1" -server 10.10.1.249 -debug At line:1 char:27

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ".\PRTG-VeeamBRStats.ps1" -server 10.10.1.249 At line:1 char:27

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ".\PRTG-VeeamBRStats.ps1" .\PRTG-VeeamBRStats.ps1 PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ".\PRTG-VeeamBRStats.ps1" -Server 10.10.1.249 At line:1 char:27

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Monday, June 29, 2020 4:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Ok I have the console installed and after running your command I just have a prompt again. I believe it is connected at this point.

Sounds great. Might you please run the PS1 file in the PowerShell prompt and share the result?

PRTG-VeeamBRStats.ps1 -Server "" -Debug

Now I am unsure how to set up the Sensor in PRTG. Sorry for being so needy. We just purchased PRTG 2 weeks ago and I have been deep into it, getting it configured, but the custom sensors are getting me a bit twisted.

Have you already read this Blog Posts? https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/ https://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-managerhttps://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-manager

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651329468, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU2IXW7P5CKETHSQXWTRZDXO3ANCNFSM4OHIHX2A.

signalcc commented 4 years ago

And I received this from PRTG New Status at 6/29/2020 4:48:00 PM (US Eastern Standard Time): Down Last Message: Your request has timed out. Depending on the sensor type you use, the reason might be that the sensor could not connect to the target host or that a PowerShell command takes too long to execute. For more information,

Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Monday, June 29, 2020 4:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Ok I have the console installed and after running your command I just have a prompt again. I believe it is connected at this point.

Sounds great. Might you please run the PS1 file in the PowerShell prompt and share the result?

PRTG-VeeamBRStats.ps1 -Server "" -Debug

Now I am unsure how to set up the Sensor in PRTG. Sorry for being so needy. We just purchased PRTG 2 weeks ago and I have been deep into it, getting it configured, but the custom sensors are getting me a bit twisted.

Have you already read this Blog Posts? https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/https://mycloudrevolution.com/de/2016/03/21/veeam-prtg-sensor-reloaded/ https://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-managerhttps://kb.paessler.com/en/topic/72030-monitoring-veeam-backup-replication-without-veeam-enterprise-manager

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651329468, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU2IXW7P5CKETHSQXWTRZDXO3ANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

Sorry, the parameter for the server is -BRHost.

signalcc commented 4 years ago

Ok that helped.

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-VeeamBRStats.ps1 -BRHost 10.1x.x.x -Debug DEBUG: Starting to Process Connection to '10.10.1.249' with user 'jraymond' ...

Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Connecting BRHost '10.1x.x.x' with user 'jxxxxxx'...

Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): Y

Successful-Backups 35 1 1 Warning-Backups 0 1 1 0 1 Failes-Backups 0 1 1 0 1 Failed-Backups 0 1 1 0 1 Running-Backups 0 1 1 TotalBackupRead 305 Custom GB 1 1 TotalBackupTransfer 213 Custom GB 1 1 Successful-BackupCopys 0 1 1 Warning-BackupCopys 0 1 1 0 1 Failes-BackupCopys 0 1 1 0 1 Failed-BackupCopys 0 1 1 0 1 Running-BackupCopys 0 1 1 Idle-BackupCopys 7 1 1 Successful-Replications 0 1 1 Warning-Replications 0 1 1 0 1 Failes-Replications 0 1 1 0 1 Failed-Replications 0 1 1 0 1 Running-Replications 0 1 1 Successful-Endpoints 2 1 1 Warning-Endpoints 0 1 1 0 1 Failes-Endpoints 0 1 1 0 1 Running-Endpoints 0 1 1 DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y DEBUG: Cloud Repo Section Entered... Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1 : Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryStoragesSize'. At line:1 char:1 + .\PRTG-VeeamBRStats.ps1 -BRHost 10.1x.x.x -Debug + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.ps1 C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1 : at , C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VeeamBRStats.ps1: line 532 at , : line 1 At line:1 char:1 + .\PRTG-VeeamBRStats.ps1 -BRHost 10.1x.x.x -Debug + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PRTG-VeeamBRStats.ps1 1 Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryStoragesSize'. PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> [cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png] Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com From: Markus Kraus Sent: Monday, June 29, 2020 5:03 PM To: vMarkusK/Advanced-PRTG-Sensors Cc: Jay Raymond ; Author Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55) Sorry, the parameter for the server is -BRHost . — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
signalcc commented 4 years ago

I think I understand what my problem is, however, I cannot find/figure out how to correct it.

Our Veeam server is not on the domain for security purposes. And, to be completely honest, it saved my backside once already. A 3rd Party software we use had an RCEV and we go hit. I walked in on my birthday to all 22 servers encrypted. However, they never found the backup server. It was safe and I had us back up and running (85%) by 8:30 AM. (I come in around 5:30 AM). So, I will never put a backup server on my domain again.

However, in my testing on this, I believe that is where the issue is. I have changed the parent device Windows Log in Credentials to the ones used to access that server locally, but it just keeps giving me the PE095 Access Denied error. When I run the script locally on the PRTG server, I get that it can’t access the host with the session user jXXXXX (my domain account). The PRTG main account is a domain admin account as well. So from what I have read on your blog, PRTG is using the Service account I gave it to open PS, then is supposed to use the credentials I put in the Windows Credentials to access Veeam, but it does not seem to be doing that. I have set the “Use Windows Credentials of the parent device” Radio button and verified those credentials are that of a local user with admin rights on the backup server and I have the name of the server in there as well. I have tried using both the server name and the ip address in that line with no luck.

So, to me it seems that not having it on the domain may keep me from being able to use this sensor unless I can figure out why it won’t use the credentials listed in the settings in PRTG. Am I wrong in this? Below is a screen shot of the sensor settings.

[cid:image001.png@01D64EBA.7A81D160]

I have tried this as both an Advanced EXE sensor and as a Standard. I have the same issue either way. [cid:image002.png@01D64EBC.83713160]

I’m not sure what else I can do. Please let me know if I am just missing something silly here. I would really love to have this working. Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Monday, June 29, 2020 5:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Sorry, the parameter for the server is -BRHost .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651364519, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU3446WMMMUQ6XUAAY3RZD6R3ANCNFSM4OHIHX2A.

signalcc commented 4 years ago

Ok, I have ripped the last bit of hair out of my head. I kept digging, running down the damn rabbit hole.

It’s a user issue, I know that. I have been able to find the logs and now see that it is using the credentials I put in the host Windows Credentials section. This allows PRTG to connect and start the script now. However, when it tries to run the script I now get the JSON error “XML: Structural error in xml file, 3 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)”

So, I added the PRTG service account as a local user on the B&R server. No Change. I added the PRTG Service account on the PRTG server as a local user, No change. I added the Veeam service account as a local admin user on the PRTG server, I no longer get Audit Failures, but now I get the JSON error above and in the logs I have this:

Failed to connect to Veeam BR Host '-BRHost back**' with user '***$'

I am really unsure why it is calling the script as the local computer account. I really don’t understand that part. But at this point I either have “Access Denied” errors or I have it trying to log into the B&R server as the local computer.

From what I can tell, the fact that it is not on the domain is the issue and adding local accounts to various servers does not fix the issue as it doesn’t have the same workgroup\ as the B&R server needs. I have a local admin account on both the PRTG server and the B&R server and I tried those credentials as well, I receive an audit failure that the account does not exists or bad password. I have tried with both computer names, I have tried with the .\ so it would pull the PC name and I have tired with it blank. If I run the script locally, it runs and returns info. I just cannot do it from PRTG.

Thanks

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Monday, June 29, 2020 5:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Sorry, the parameter for the server is -BRHost .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651364519, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU3446WMMMUQ6XUAAY3RZD6R3ANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

Maybe you can install a prtg probe on the Veeam vbr server and execute the sensor with a local account on the vbr server / probe.

That should rund way more robust.

BTW. Having the Repo or the whole VBR outside of the domain and if possible in a dedicated security zone (behind firewall) is highly recommended. Another option is a backup copy to a bachup device with non typical connection protocols, like emc DD Boost or HPE Catalyst.

signalcc commented 4 years ago

We have a cloud backup to a dedicated service and we are about to set up DraaS, so we have the backups covered. It’s funny though, I was thinking the same thing. Set the B&R server up as a probe and only have that sensor on it. But I dismissed it cause I wanted it to work the right way. LOL

I’ll give that a shot.

Thank you so much for all of your help and being so understanding. You have been a great help!!

Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 12:57 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Maybe you can install a prtg probe on the Veeam vbr server and execute the sensor with a local account on the vbr server / probe.

That should rund way more robust.

BTW. Having the Repo or the whole VBR outside of the domain and if possible in a dedicated security zone (behind firewall) is highly recommended. Another option is a backup copy to a bachup device with non typical connection protocols, like emc DD Boost or HPE Catalyst.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651919744, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKUY7XOFZZLBEXTBJ3ADRZIKMNANCNFSM4OHIHX2A.

signalcc commented 4 years ago

Markus, I am so close. In the PRTG logs it is connecting and pulling data. YAY! However, the very last lines are as follows:

1 Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryStoragesSize'.

I am also still receiving JSON errors, but I am connecting, but not showing data in PRTG. I’m much closer though. Any thoughts? I have read through your blog and all the questions and answers 30 times today.

Let me know!

Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 12:57 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Maybe you can install a prtg probe on the Veeam vbr server and execute the sensor with a local account on the vbr server / probe.

That should rund way more robust.

BTW. Having the Repo or the whole VBR outside of the domain and if possible in a dedicated security zone (behind firewall) is highly recommended. Another option is a backup copy to a bachup device with non typical connection protocols, like emc DD Boost or HPE Catalyst.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651919744, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKUY7XOFZZLBEXTBJ3ADRZIKMNANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

You have one ore more Veeam Cloud Connect Repos Connected, right Get-VBRBackupRepository | Select Type?

Which Veeam Version are you currently using? Are you using the latest version of the script from the GitHub Repo (last Update 6 months ago)?

The latest version includes a Fix for Veeam v10 and Cloud Connect Repos. This fix results in incompatibility with v9.x if Cloud Repos are connected.

signalcc commented 4 years ago

I am on V10.0.0.0.4461 P1 for Veeam I only downloaded your script for the first time from GitHub less than a week ago. Last Thursday I think. I have 2 Cloud Repos, both with iLand, one for cold storage and one for cloud storage.

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

You have one ore more Veeam Cloud Connect Repos Connected, right Get-VBRBackupRepository | Select Type?

Which Veeam Version are you currently using? Are you using the latest version of the script from the GitHub Repo (last Update 6 months ago)?

The latest version includes a Fix for Veeam v10 and Cloud Connect Repos. This fix results in incompatibility with v9.x if Cloud Repos are connected.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651984491, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU4IO5CKRPWYUSNNJPLRZIZFJANCNFSM4OHIHX2A.

signalcc commented 4 years ago

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Get-VBRBackupRepository

Name Type Host FriendlyPath


Ut** CifsShare Back \uti*\ap... Local Backups WinLocal Back B:\Backups iLandObjectStorage WinLocal Back I:\Backups iland Cloud repository 1 Cloud str-backup... \ban iland Cloud Repository Cloud str-backup... \ban Sou** CifsShare Back** \sou***...

Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

You have one ore more Veeam Cloud Connect Repos Connected, right Get-VBRBackupRepository | Select Type?

Which Veeam Version are you currently using? Are you using the latest version of the script from the GitHub Repo (last Update 6 months ago)?

The latest version includes a Fix for Veeam v10 and Cloud Connect Repos. This fix results in incompatibility with v9.x if Cloud Repos are connected.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651984491, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU4IO5CKRPWYUSNNJPLRZIZFJANCNFSM4OHIHX2A.

signalcc commented 4 years ago

Here is the output of the Sensor Data log.

Data['linuxloginpassword'].asString := ''; Data['notonpod'].asString := '0'; Data['fastcount'].asString := '0'; Data['lastmsg'].asString := '#Y2 Structural error in xml file, 4 open items. @#O231[Invalid JSON.]'; Data['resultfile'].asString := 'Result of Sensor 5457.txt'; Data['windowsloginusername'].asString := 'username'; Data['hostv6'].asString := '::1'; Data['exefile'].asString := 'PSx64.exe'; Data['lastuptime'].asString := '0'; Data['writeresult'].asString := '1'; Data['blockedsens'].asString := ''; Data['reqmsginterval'].asString := '300'; Data['windowslogindomain'].asString := ''; Data['tlsexplicit_imap'].asString := ''; Data['channelnames'].asString := ''; Data['tlsexplicit_default'].asString := ''; Data['canlinux'].asString := '0'; Data['isexesensor'].asString := '1'; Data['windowsloginpassword'].asString := '***'; Data['environment'].asString := ''; Data['mutexname'].asString := 'VeeamMutex'; Data['channelinfos'].asString := '{}'; Data['uptimecount'].asString := '0'; Data['reboot'].asString := '44011.7850396528'; Data['usednstime'].asString := '0'; Data['linuxlogindomain'].asString := ''; Data['tlsexplicit_port'].asString := ''; Data['monitorchange'].asString := ''; Data['inerror'].asString := '1'; Data['sensorid'].asString := '5457'; Data['ipversion'].asString := '0'; Data['tlsexplicit_smtp'].asString := ''; Data['host'].asString := '127.0.0.1'; Data['usewindowsauthentication'].asString := '0'; Data['simulate'].asString := '0'; Data['tlsexplicit_ftp'].asString := ''; Data['timeout'].asString := '300'; Data['exeparams'].asString := '-f="PRTG-VeeamBRStats.ps1"'; Data['momopersistent'].asString := ''; Data['tlsexplicit_pop3'].asString := '';

This is the output from the other sensor log.

C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VeeamBRStats.ps1 : Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryStoragesSize'. At line:1 char:1

So, it is fully pulling all the data, only has the issue at the very end.

The logs are from PRTG doing the pull of info. Not from me doing them. So it is connected and it is pulling data, but it cannot display it, unless I am reading it wrong?

Thanks!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:03 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

You have one ore more Veeam Cloud Connect Repos Connected, right Get-VBRBackupRepository | Select Type?

Which Veeam Version are you currently using? Are you using the latest version of the script from the GitHub Repo (last Update 6 months ago)?

The latest version includes a Fix for Veeam v10 and Cloud Connect Repos. This fix results in incompatibility with v9.x if Cloud Repos are connected.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-651984491, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU4IO5CKRPWYUSNNJPLRZIZFJANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

The issue seems to be a changed method for Cloud Repos. Might you please run this snippet on your VBR Servers PS Console?

Add-PSSnapin VeeamPSSnapIn
Connect-VBRServer -Server localhost
[Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$_.Type -notmatch "SanSnapshotOnly"}    # Get all Repositories Except SAN
[Array]$CloudRepos = $AllRepos | Where-Object {$_.Type -match "Cloud"}    # Get all Cloud Repositories

$TestRepo = $CloudRepos | Select-Object -First 1

$RepoReport = @()
if ($TestRepo) {
    Write-Debug "Cloud Repo Section Entered..."
    $CloudProviders = Get-VBRCloudProvider

    foreach ($CloudProvider in $CloudProviders){
        if ($CloudProvider.Resources){
            foreach ($CloudProviderRessource in $CloudProvider.Resources){
                $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
                $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
                $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepos.Id.Guid))/1GB,2)
                $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
                $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
                If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
                ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
                ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
                Else {$Status = "OK"}
                $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
                $Object."Repository Name" = $CloudProviderRessource.RepositoryName
                $Object."Free (GB)" = $totalFreeGb
                $Object."Total (GB)" = $totalSpaceGb
                $Object."Free (%)" = $freePercentage
                $Object."Status" = $Status

                $RepoReport += $Object
            }
        }
    }

}

## New Method
$RepoReport | Format-Table -AutoSize

$RepoReport = @()
if ($TestRepo) {
    Write-Debug "Cloud Repo Section Entered..."
    $CloudProviders = Get-VBRCloudProvider

    foreach ($CloudProvider in $CloudProviders){
        if ($CloudProvider.Resources){
            foreach ($CloudProviderRessource in $CloudProvider.Resources){
                $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
                $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
                $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryStoragesSize($CloudRepos.Id.Guid))/1GB,2)
                $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
                $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
                If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
                ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
                ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
                Else {$Status = "OK"}
                $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
                $Object."Repository Name" = $CloudProviderRessource.RepositoryName
                $Object."Free (GB)" = $totalFreeGb
                $Object."Total (GB)" = $totalSpaceGb
                $Object."Free (%)" = $freePercentage
                $Object."Status" = $Status

                $RepoReport += $Object
            }
        }
    }

}

## Original
$RepoReport | Format-Table -AutoSize

This is only the VBR Cloud Repo Part of the script with two versions of the method. I am not able to verify that part by myself because I do have no access to a cloud repo.

signalcc commented 4 years ago

Gladly!

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Add-PSSnapin VeeamPSSnapIn PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Connect-VBRServer -Server localhost PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> [Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$.Type -notmatch "SanSnapshotOnly"} # Get all Repositories Except SAN PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> [Array]$CloudRepos = $AllRepos | Where-Object {$.Type -match "Cloud"} # Get all Cloud Repositories PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $TestRepo = $CloudRepos | Select-Object -First 1 PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport = @() PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."
$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){
    if ($CloudProvider.Resources){
        foreach ($CloudProviderRessource in $CloudProvider.Resources){
            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepos.Id.Guid))/1GB,2)
            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
            Else {$Status = "OK"}
            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
            $Object."Repository Name" = $CloudProviderRessource.RepositoryName
            $Object."Free (GB)" = $totalFreeGb
            $Object."Total (GB)" = $totalSpaceGb
            $Object."Free (%)" = $freePercentage
            $Object."Status" = $Status

            $RepoReport += $Object
        }
    }
}

} Cannot convert argument "repositoryId", with value: "System.Object[]", for "GetRepositoryBackupsSize" to type "System.Guid": "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Guid"." At line:10 char:17

  • ... $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core ...
  • CategoryInfo : NotSpecified: (:) [], MethodException
  • FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ## New Method PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport | Format-Table -AutoSize

Repository Name Free (GB) Total (GB) Free (%) Status


iland Cloud Repository 62000 62000 100 OK

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport = @() PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."
$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){
    if ($CloudProvider.Resources){
        foreach ($CloudProviderRessource in $CloudProvider.Resources){
            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryStoragesSize($CloudRepos.Id.Guid))/1GB,2)
            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
            Else {$Status = "OK"}
            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
            $Object."Repository Name" = $CloudProviderRessource.RepositoryName
            $Object."Free (GB)" = $totalFreeGb
            $Object."Total (GB)" = $totalSpaceGb
            $Object."Free (%)" = $freePercentage
            $Object."Status" = $Status

            $RepoReport += $Object
        }
    }
}

} Method invocation failed because [Veeam.Backup.Core.CBackupRepository] does not contain a method named 'GetRepositoryStoragesSize'. At line:10 char:17

  • ... $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core ...
  • CategoryInfo : InvalidOperation: (:) [], RuntimeException
  • FullyQualifiedErrorId : MethodNotFound

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ## Original PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport | Format-Table -AutoSize

Repository Name Free (GB) Total (GB) Free (%) Status


iland Cloud Repository 62000 62000 100 OK

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:39 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

The issue seems to be a changed method for Cloud Repos. Might you please run this snippet on your VBR Servers PS Console?

Add-PSSnapin VeeamPSSnapIn

Connect-VBRServer -Server localhost

[Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$_.Type -notmatch "SanSnapshotOnly"} # Get all Repositories Except SAN

[Array]$CloudRepos = $AllRepos | Where-Object {$_.Type -match "Cloud"} # Get all Cloud Repositories

$TestRepo = $CloudRepos | Select-Object -First 1

$RepoReport = @()

if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."

$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){

    if ($CloudProvider.Resources){

        foreach ($CloudProviderRessource in $CloudProvider.Resources){

            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}

            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)

            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepos.Id.Guid))/1GB,2)

            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)

            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)

            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}

            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}

            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}

            Else {$Status = "OK"}

            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"

            $Object."Repository Name" = $CloudProviderRessource.RepositoryName

            $Object."Free (GB)" = $totalFreeGb

            $Object."Total (GB)" = $totalSpaceGb

            $Object."Free (%)" = $freePercentage

            $Object."Status" = $Status

            $RepoReport += $Object

        }

    }

}

}

New Method

$RepoReport | Format-Table -AutoSize

$RepoReport = @()

if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."

$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){

    if ($CloudProvider.Resources){

        foreach ($CloudProviderRessource in $CloudProvider.Resources){

            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}

            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)

            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryStoragesSize($CloudRepos.Id.Guid))/1GB,2)

            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)

            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)

            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}

            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}

            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}

            Else {$Status = "OK"}

            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"

            $Object."Repository Name" = $CloudProviderRessource.RepositoryName

            $Object."Free (GB)" = $totalFreeGb

            $Object."Total (GB)" = $totalSpaceGb

            $Object."Free (%)" = $freePercentage

            $Object."Status" = $Status

            $RepoReport += $Object

        }

    }

}

}

Original

$RepoReport | Format-Table -AutoSize

This is only the VBR Cloud Repo Part of the script with two versions of the method. I am not able to verify that part by myself because I do have no access to a cloud repo.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-652001788, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU6LHNFTNN2FGSCIYETRZI5M7ANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

And another try (We are already one step ahead):

Add-PSSnapin VeeamPSSnapIn
Connect-VBRServer -Server <Your Server>
[Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$_.Type -notmatch "SanSnapshotOnly"}    # Get all Repositories Except SAN
[Array]$CloudRepos = $AllRepos | Where-Object {$_.Type -match "Cloud"}    # Get all Cloud Repositories

$TestRepo = $CloudRepos | Select-Object -First 1

$RepoReport = @()
if ($TestRepo) {
    Write-Debug "Cloud Repo Section Entered..."
    $CloudProviders = Get-VBRCloudProvider

    foreach ($CloudProvider in $CloudProviders){
        if ($CloudProvider.Resources){
            foreach ($CloudProviderRessource in $CloudProvider.Resources){
                $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
                $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
                $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2)
                $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
                $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
                If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
                ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
                ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
                Else {$Status = "OK"}
                $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
                $Object."Repository Name" = $CloudProviderRessource.RepositoryName
                $Object."Free (GB)" = $totalFreeGb
                $Object."Total (GB)" = $totalSpaceGb
                $Object."Free (%)" = $freePercentage
                $Object."Status" = $Status

                $RepoReport += $Object
            }
        }
    }

}

## New Method
$RepoReport | Format-Table -AutoSize
signalcc commented 4 years ago

Sir yes sir!! I’m trying to figure out the JSON thing, but man it’s making my head hurt and I’m not getting anywhere. LOL

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Add-PSSnapin VeeamPSSnapIn PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> Connect-VBRServer -Server At line:1 char:27

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> [Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$.Type -notmatch "SanSnapshotOnly"} # Get all Repositories Except SAN PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> [Array]$CloudRepos = $AllRepos | Where-Object {$.Type -match "Cloud"} # Get all Cloud Repositories PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $TestRepo = $CloudRepos | Select-Object -First 1 PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport = @() PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."
$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){
    if ($CloudProvider.Resources){
        foreach ($CloudProviderRessource in $CloudProvider.Resources){
            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}
            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)
            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2)
            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)
            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)
            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}
            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}
            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}
            Else {$Status = "OK"}
            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"
            $Object."Repository Name" = $CloudProviderRessource.RepositoryName
            $Object."Free (GB)" = $totalFreeGb
            $Object."Total (GB)" = $totalSpaceGb
            $Object."Free (%)" = $freePercentage
            $Object."Status" = $Status

            $RepoReport += $Object
        }
    }
}

} PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ## New Method PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> $RepoReport | Format-Table -AutoSize

Repository Name Free (GB) Total (GB) Free (%) Status


iland Cloud Repository 37192.52 62000 60 OK

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:48 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

And another try (We are already one step ahead):

Add-PSSnapin VeeamPSSnapIn

Connect-VBRServer -Server

[Array]$AllRepos = Get-VBRBackupRepository | Where-Object {$_.Type -notmatch "SanSnapshotOnly"} # Get all Repositories Except SAN

[Array]$CloudRepos = $AllRepos | Where-Object {$_.Type -match "Cloud"} # Get all Cloud Repositories

$TestRepo = $CloudRepos | Select-Object -First 1

$RepoReport = @()

if ($TestRepo) {

Write-Debug "Cloud Repo Section Entered..."

$CloudProviders = Get-VBRCloudProvider

foreach ($CloudProvider in $CloudProviders){

    if ($CloudProvider.Resources){

        foreach ($CloudProviderRessource in $CloudProvider.Resources){

            $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)}

            $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2)

            $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2)

            $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2)

            $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100)

            If ($freePercentage -lt $repoCritical) {$Status = "Critical"}

            ElseIf ($freePercentage -lt $repoWarn) {$Status = "Warning"}

            ElseIf ($freePercentage -eq "Unknown") {$Status = "Unknown"}

            Else {$Status = "OK"}

            $Object = "" | Select-Object "Repository Name", "Free (GB)", "Total (GB)", "Free (%)", "Status"

            $Object."Repository Name" = $CloudProviderRessource.RepositoryName

            $Object."Free (GB)" = $totalFreeGb

            $Object."Total (GB)" = $totalSpaceGb

            $Object."Free (%)" = $freePercentage

            $Object."Status" = $Status

            $RepoReport += $Object

        }

    }

}

}

New Method

$RepoReport | Format-Table -AutoSize

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-652006111, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKU52HQU4BCSRZNFNK7TRZI6NLANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

Looks good.

Might you please run this fixed version in Debug mode (on the VBR Server in PS Console): https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/FixCloudRepoMethod/Veeam/PRTG-VeeamBRStats.ps1

./PRTG-VeeamBRStats.ps1 -Server localhost -Debug

signalcc commented 4 years ago

Genius!!! Now to get PRTG to show it!!

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> ./PRTG-VeeamBRStats.ps1 -Debug DEBUG: Starting to Process Connection to 'localhost' with user 'jraymond' ...

Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): Y DEBUG: BRHost 'localhost' is Already Connected...

Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y

Successful-Backups 35 1 1 Warning-Backups 0 1 1 0 1 Failes-Backups 0 1 1 0 1 Failed-Backups 0 1 1 0 1 Running-Backups 0 1 1 TotalBackupRead 316 Custom GB 1 1 TotalBackupTransfer 224 Custom GB 1 1 Successful-BackupCopys 0 1 1 Warning-BackupCopys 0 1 1 0 1 Failes-BackupCopys 0 1 1 0 1 Failed-BackupCopys 0 1 1 0 1 Running-BackupCopys 0 1 1 Idle-BackupCopys 7 1 1 Successful-Replications 0 1 1 Warning-Replications 0 1 1 0 1 Failes-Replications 0 1 1 0 1 Failed-Replications 0 1 1 0 1 Running-Replications 0 1 1 Successful-Endpoints 2 1 1 Warning-Endpoints 0 1 1 0 1 Failes-Endpoints 0 1 1 0 1 Running-Endpoints 0 1 1 DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): DEBUG: Veeam.Backup.Model.CBackupRepositoryInfo Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): DEBUG: Cloud Repo Section Entered... Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): REPO - UtilSvr 100 Percent 1 1 20 10 1 REPO - Local Backups 66 Percent 1 1 20 10 1 REPO - iLandObjectStorage 23 Percent 1 1 20 10 1 REPO - SouthwestUtil 18 Percent 1 1 20 10 1 REPO - Backup Copy Drive 64 Percent 1 1 20 10 1 REPO - iland Cloud Repository 60 Percent 1 1 20 10 1

Repository Name Free (GB) Total (GB) Free (%) Status


UtilSvr 0.00 0.00 100 OK Local Backups 29813.77 45055.94 66 OK iLandObjectStorage 2787.57 12287.94 23 OK SouthwestUtil 69.18 375.00 18 Warning Backup Copy Drive 6604.26 10239.94 64 OK iland Cloud Repository 37192.52 62000 60 OK

Successful Backups : 35 Warning Backups : 0 Failes Backups : 0 Failed Backups : 0 Running Backups : 0 Total Backup Transfer : 224 Total Backup Read : 316 Warning BackupCopys : 0 Failes BackupCopys : 0 Failed BackupCopys : 0 Running BackupCopys : 0 Idle BackupCopys : 7 Successful Replications : 0 Warning Replications : 0 Failes Replications : 0 Failed Replications : 0 Running Replications : 0 Seccessful Endpoints : 2 Warning Endpoints : 0 Failes Endpoints : 0 Running Endpoints : 0

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:53 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Looks good.

Might you please run this fixed version in Debug mode: https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/FixCloudRepoMethod/Veeam/PRTG-VeeamBRStats.ps1https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/FixCloudRepoMethod/Veeam/PRTG-VeeamBRStats.ps1

./PRTG-VeeamBRStats.ps1 -Server localhost -Debug

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-652008684, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKUYOG4S34BIAJ4FOBM3RZI7CPANCNFSM4OHIHX2A.

signalcc commented 4 years ago

Mother of all that is holy you are an absolute genius!!! PRTG is showing it now!!

Thank you so much for all of your hard work!!!! You are a gentleman and a scholar!!!!

Thank you!

[cid:BI60Year_5784b6dd-39be-4d9a-9062-4bb24c77a52c.png]

Jay Raymond, MCSE, CSSP, MCSA, A+, NET+ Senior Network Engineer 2701 Prince Street Fort Myers, Florida 33916 Office: 239-332-4646 | Fax: 239-332-5928 Direct: 239-344-2712 www.bandiflorida.com

From: Markus Kraus notifications@github.com Sent: Tuesday, June 30, 2020 3:53 PM To: vMarkusK/Advanced-PRTG-Sensors Advanced-PRTG-Sensors@noreply.github.com Cc: Jay Raymond jraymond@bandiflorida.com; Author author@noreply.github.com Subject: Re: [vMarkusK/Advanced-PRTG-Sensors] Hate to sound like an ID10T (#55)

Looks good.

Might you please run this fixed version in Debug mode: https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/FixCloudRepoMethod/Veeam/PRTG-VeeamBRStats.ps1https://github.com/vMarkusK/Advanced-PRTG-Sensors/blob/FixCloudRepoMethod/Veeam/PRTG-VeeamBRStats.ps1

./PRTG-VeeamBRStats.ps1 -Server localhost -Debug

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vMarkusK/Advanced-PRTG-Sensors/issues/55#issuecomment-652008684, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFKUYOG4S34BIAJ4FOBM3RZI7CPANCNFSM4OHIHX2A.

vMarkusK commented 4 years ago

Thank you for submitting this issue and verifying the fix.