Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
pankajnp
Influencer
Posts: 12
Liked: 1 time
Joined: Apr 01, 2022 6:46 am
Full Name: Pankaj Patil
Contact:

Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by pankajnp »

Hi Team,
Can we enable the feature specifically for the free tape pool? We should get an alarm when a media pool free tape left number is less than 10 or 20 or below the defined threshold.

Case # 06246536
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by Mildur » 1 person likes this post

Hello Pankaj

Thanks for your request. May I know the use case for the request? Even if there are no free tapes available, the backup server will also use online tapes which are already expired. They won't show up in the free media pool.

May I suggest a workaround over PowerShell?

1) Get all tapes of the free media pool:

Code: Select all

$pool = Get-VBRTapeMediaPool -Name Free
$Tapes = Get-VBRTapeMedium | Where-Object {$_.MediaPoolId -eq $pool.ID} | measure
$Tapes.Count
2) If the value is less than 10, send out a mail.

Code: Select all

If ($Tapes.Count –lt 10) { Send-MailMessage -To 'helpdesk@domain.tld' -From 'backupserver@domain.tld' -Subject 'Not enough tapes available' -Body 'Please add new tapes to media pool' -SmtpServer 'smtp.domain.tld' -Port 587 }
The complete script:

Code: Select all

$pool = Get-VBRTapeMediaPool -Name Free
$Tapes = Get-VBRTapeMedium | Where-Object {$_.MediaPoolId -eq $pool.ID} | measure
$Tapes.Count

If ($Tapes.Count –lt 10) { Send-MailMessage -To 'helpdesk@domain.tkd' -From 'backupserver@domain.tld' -Subject 'Not enough tape available' -Body 'Please add new tapes to media pool' -SmtpServer 'smtp.domain.tld' -Port 587 }
Best,
Fabian
Product Management Analyst @ Veeam Software
pankajnp
Influencer
Posts: 12
Liked: 1 time
Joined: Apr 01, 2022 6:46 am
Full Name: Pankaj Patil
Contact:

Re: Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by pankajnp »

Thanks Fabian, I will test the script and let you know.

And below is the Veeam Case ID

Case # 06246536
pankajnp
Influencer
Posts: 12
Liked: 1 time
Joined: Apr 01, 2022 6:46 am
Full Name: Pankaj Patil
Contact:

Re: Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by pankajnp »

Many thanks, script is working. :)

Also, could you please help me to display the tape count in the email body
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by Mildur » 2 people like this post

You're welcome :)

i changed the order of the script and now I generate the body with the amount of tapes before executing the Send-MailMessage command. Please let me know if it works.

Code: Select all

$pool = Get-VBRTapeMediaPool -Name Free
$Tapes = Get-VBRTapeMedium | Where-Object {$_.MediaPoolId -eq $pool.ID} | measure
$Tapes.Count

$Recipient = 'helpdesk@domain.tkd'
$Sender = 'backupserver@domain.tld'
$SMTPServer = 'smtp.domain.tld'
$Subject = 'Not enough tape available'
$Body = 'Please add new tapes to media pool. Only ' + $Tapes.Count + ' tapes are available.' 
$Port = 587

If ($Tapes.Count –lt 10) { Send-MailMessage -To $Recipient -From $Sender -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Port $Port }
Best,
Fabian
Product Management Analyst @ Veeam Software
pankajnp
Influencer
Posts: 12
Liked: 1 time
Joined: Apr 01, 2022 6:46 am
Full Name: Pankaj Patil
Contact:

Re: Feature request: - Alarm when a media pool free tapes left number is less than 10 or 20

Post by pankajnp »

Many thanks, all set new script is also working. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests