Highlighted
PS-VCORE
1 Copper

Re: Powershell script to monitor Datadomains

Honestly, there is a free solution to monitor, trend, and forecast on your DD's, DDMC (Data Domain Management Center). Ask your sales rep or VAR about it, It's a downloadable vApp (ova) for your VMWare environment that not only monitors, but also allows you to perform bulk tasks (like upgrade DDOS across your environment at the push of a button).  Easy to use and configure, and very informative.

The official product info is here: http://www.emc.com/data-protection/data-domain/data-domain-management.htm

A $0 PO is all that is usually required to receive your license key. Even if you only want to use it with one DD, the info is useful, and it's worth the couple of hours you'll spend setting it up.

0 Kudos
MIchal_Wilk
1 Copper

Re: Powershell script to monitor Datadomains

there's something tricky in what you are saying........ none of df is and will be working on windows...... you are either using :

get-WmiObject win32_logicaldisk  or Get-PSDrive C | Select-Object Used,Free with then simple math do alerting for you.......

you just need to use same analogy when re-creating script for dd.....or better speak with someone who wrote that script for you and pass him commands to use on dd.

0 Kudos
miralem1
1 Copper

Re: Powershell script to monitor Datadomains

With systems that don't have PowerShell Modules available, I like to use plink , its putty cli.

Here is a sample, using plink ssh to data domain and collect capacity.

Requirement:

plink.exe located on server where script is running.

server added to email relay to send email. (if you want email notification)

$fileSys = echo "y" | C:\Temp\plink.exe username@fqdn_or_IP -pw UserPassword "filesys show space"

$ddStats = $((($fileSys -match "^/data: post-comp") | select -Last 1).Split() | where {$_ -ne ""}) -Match "^[0-9]"

$dataDomainCapacity = [pscustomobject][ordered] @{

Name = "YourDataDomain"

SizeTB = [math]::Round("$($ddStats[0])GB" / 1TB,2)

UsedTB = [math]::Round("$($ddStats[1])GB" / 1TB,2)

AvailbleTB = [math]::Round("$($ddStats[2])GB" / 1TB,2)

'Used %' = [math]::Round(($ddStats[1] / $ddStats[0])*100,2)

}

$dataDomainCapacity | ft -AutoSize

# Check used % and send email.

# fill in bellow, assuming your server was added to email relay.

function send-report ($report, $subject)

{

$emailSettings = @{

From = ""

To = ""

Subject = "$subject"

SmtpServer = ""

Body = "$($report | Out-String -Width 100)"

}

Send-MailMessage @emailSettings

}

# check used capacity and notify if exceeted

if($dataDomainCapacity.'Used %' -gt 60)

{

    send-report -Subject "Data Domain Used Exceeded 60%" -report $dataDomainCapacity

}

0 Kudos