vMarkusK / Advanced-PRTG-Sensors

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

Please add SureBackup Jobs #104

Open susishopware opened 11 months ago

susishopware commented 11 months ago

Hey, I'm not sure if its already integrated in "Successfull Backups" but it would be great if there is a separate column for SureBackup Jobs.

Thanks for your service!

SHellSys commented 9 months ago

I added the SureBackups in my sensor:

$allSureBkSesh = @(Get-VBRSureBackupSession | Where-Object{($_.CreationTime -ge (Get-Date).AddHours(-$HourstoCheck))}) # Get all Sure Backup Sessions

$successSessionSureBk = @($allSureBkSesh | Where-Object{$_.Result -eq "Success"})
    $warnungSessionSureBk = @($allSureBkSesh | Where-Object{$_.Result -eq "Warning"})
    $failsSessionSureBk = @($allSureBkSesh | Where-Object{$_.Result -eq "Failed"})
    $runningSessionSureBk = @($allSureBkSesh | Where-Object{$_.State -eq "working"})

$Count = $successSessionSureBk.Count
    $xmlOutput = $xmlOutput + "<result>
                <channel>Successful-SUREBackups</channel>
                <value>$Count</value>
                <showChart>1</showChart>
                <showTable>1</showTable>
                </result>"
    $Count = $warnungSessionSureBk.Count
    $xmlOutput = $xmlOutput + "<result>
                <channel>Warning-SUREBackups</channel>
                <value>$Count</value>
                <showChart>1</showChart>
                <showTable>1</showTable>
                <LimitMaxWarning>0</LimitMaxWarning>
                <LimitMode>1</LimitMode>
                </result>"
    $Count = $failsSessionSureBk.Count
    $xmlOutput = $xmlOutput + "<result>
                <channel>Failes-SUREBackups</channel>
                <value>$Count</value>
                <showChart>1</showChart>
                <showTable>1</showTable>
                <LimitMaxError>0</LimitMaxError>
                <LimitMode>1</LimitMode>
                </result>"
    $Count = $runningSessionSureBk.Count
    $xmlOutput = $xmlOutput + "<result>
                <channel>Running-SUREBackups</channel>
                <value>$Count</value>
                <showChart>1</showChart>
                <showTable>1</showTable>
                </result>"