Counting the number of active backups in Veeam and write this number in an XML file
This script is used for counting the number of active backups in Veeam and write this number in an XML file for further reference. I use Netcrunch as a monitoring tool and it can proces the content of XML files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#script for counting the number of running backups in Veeam and # place this number in a XML file for processing in Netcrunch #Load the Veeam Powershell commandlets Add-PSSnapin Veeampssnapin #get all jobs from Veeam $jobs= Get-VBRJob #get running jobs $runningjobs = $jobs |where{$_.isrunning -eq "True" } #count running jobs $countjobsrunning = $runningjobs.count #Read the XML file [xml]$xmlcontent = get-content c:\scripts\runningbackups.xml #Adjust and save the XML file $xmlcontent.ncopenmon.counters.counter.'#text' = "$countjobsrunning" $xmlcontent.Save("c:\scripts\runningbackups.xml") |