Hello,
I want to create a script that generates an alert when a repository is below 10% free space.
The command Get-VBRBackupRepository is the only cmd that I can find that would get this info but it does not include "capacity" and "free" properties.
Anyone had this problem before or know if there is an alternative to Get-VBRBackupRepository?
Seems to have everything else -
Info :
Host :
Id :
Name :
HostId :
MountHostId :
Description :
CreationTime :
Path :
FullPath :
FriendlyPath :
ShareCredsId :
Type :
Status :
IsUnavailable :
Group :
UseNfsOnMountHost :
VersionOfCreation :
Tag :
IsTemporary :
TypeDisplay :
IsRotatedDriveRepository :
EndPointCryptoKeyId :
CryptoKeyId :
Options :
HasBackupChainLengthLimitation :
IsSanSnapshotOnly :
IsDedupStorage :
SplitStoragesPerVm :
IsImmutabilitySupported :
-
- Influencer
- Posts: 15
- Liked: 2 times
- Joined: Mar 02, 2022 10:07 am
- Full Name: Darren Flatman
- Contact:
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Get total + used space for Veeam repository
Hi Darren,
Before v11 these properties were contained in CBackupRepository.Info property. In v11 we introduced some underlying changes, so these properties were moved to CRepositoryContainer class. You can find the detailes here. For object storages it gets a bit tricky, I'd advise to check this post.
Please note that all the solutions in the referenced topics are considered as workarounds and are not supported.
Thanks,
Oleg
Before v11 these properties were contained in CBackupRepository.Info property. In v11 we introduced some underlying changes, so these properties were moved to CRepositoryContainer class. You can find the detailes here. For object storages it gets a bit tricky, I'd advise to check this post.
Please note that all the solutions in the referenced topics are considered as workarounds and are not supported.
Thanks,
Oleg
-
- Influencer
- Posts: 15
- Liked: 2 times
- Joined: Mar 02, 2022 10:07 am
- Full Name: Darren Flatman
- Contact:
Re: Get total + used space for Veeam repository
Thanks I got the info from a reply on that thread
the script I am using is -
Its for our RMM tool to raise a ticket if the repo has less than 10%, if anyone reading this wants to use should work
the script I am using is -
Code: Select all
$Repos = get-vbrbackuprepository
$RepoDetails = foreach ($repo in $Repos) {
$Name = $Repo.Name
$ID = $Repo.ID
$Size = $Repo.GetContainer().CachedTotalSpace.InBytes / 1GB
$FreeSpace = $Repo.GetContainer().CachedFreeSpace.InBytes / 1GB
$10 = $Size * 0.1
if ($FreeSpace -le $10)
{
write-host "<-Start Result->"
write-host $Name "Warning 10% storage remaining"
write-host "<-End Result->"
exit 1
}
else
{
write-host "<-Start Result->"
write-host "Storage good"
write-host "<-End Result->"
exit 0
}
}
Who is online
Users browsing this forum: No registered users and 13 guests