PowerShell script exchange
Post Reply
lravelo
Influencer
Posts: 16
Liked: 2 times
Joined: Dec 28, 2017 8:04 pm
Full Name: Laz Ravelo
Location: Doral, FL
Contact:

Powershell script for available tapes in free pool - Nagios

Post by lravelo »

I've created a script that checks against the amount of tapes in the Free pool in Veeam that can be used in Nagios, Icinga, etc

Code: Select all

#Title:veeam_media_pool_quantity.ps1
#Description:This is a Nagios plug-in that will alert when the Free media
#pool starts getting low
#Author:Laz Ravelo
#Date:2018-01-12
#Version:1.0
#Usage:veeam_media_pool_quantity.ps1
#Notes:
#=================================================================================

# Adding required SnapIn

asnp VeeamPSSnapin

$ok = 10
$warn = 5

$mediapool = Get-VBRTapeMediaPool -Name "Free"
$quantity = $mediapool.Medium.Count

if ( $quantity -gt $ok )
{
Write-Host "OK! Free pool has acceptable number of tapes!  Quantity: $quantity"
exit 0
}

if ( $quantity -lt $ok -and $quantity -gt $warn )
{
Write-Host "WARNING! Starting to run low on free tapes!  Quantity: $quantity"
exit 1
}

if ( $quantity -lt $warn )
{
Write-Host "CRITICAL! Desperately low on free tapes!  Quantity: $quantity"
exit 2
}

if ( $quantity -eq 0 )
{
Write-Host "CRITICAL! There are no free tapes left!"
exit 2
}
Please feel free to adjust and use in your own environments! :D
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests