Unsolved
This post is more than 5 years old
1 Rookie
•
4 Posts
1
7816
December 3rd, 2015 01:00
Powershell script to monitor Datadomains
Hi,
Need your help on powershell script which can login to datadomain via ssh and email the disk utilization of the datadomain, if it reaches the threshold value.
Let say the threshold value of use% could be 90%
waiting for the replies.
Thanks
No Events found!


umichklewis
4 Apprentice
•
1.2K Posts
0
December 3rd, 2015 10:00
Is there a particular reason you want to do this via SSH? Other tools, such as DPA can collect this for you.
PatrickBetts
1 Rookie
•
116 Posts
0
December 3rd, 2015 14:00
Hi Albatross30,
DataDomains generate alerts and corresponding AutoSupports when the system reaches above 90% usage. If you get daily and alert AutoSupports from the system you will get these emails as well.
Patrick Betts
DataDomain - NET/Repl
Albatross30
1 Rookie
•
4 Posts
0
December 4th, 2015 00:00
Hi Karl,
Yes we are part of monitoring team and we have requirement that alert email should be triggered when it reaches to threshold value.
So from the Monitoring tool we are able to pull the df -h output to the windows box. So now my plan is to parse the file with powershell script and send automated email.
Any suggestions are appreciated.
Thanks
Albatross30
1 Rookie
•
4 Posts
0
December 4th, 2015 00:00
Hi Patrick,
Thanks for the info. But we as a monitoring team we are exporting the df -h output to to windows box ( where monitoring tools are installed ).
we have succeeded in exporting to txt file. but I am unable to parse the file with powershell. we have to leverage the existing windows monitoring tool box instead of provisioning linux box.
Thanks
jbrooksuk
208 Posts
0
December 9th, 2015 08:00
Isn't this a bit over complex for functionality that is essentially built into the DD.
If you only want to receive filesystem related information then you can create a notification email list just for that;
alerts notify-list create CAPACITY class filesystem
alerts notify-list add CAPACITY emails DD_FS_INFO@wherever.com
Validate with;
alerts notify-list show
I advise reading the DD command reference guide for specific details on what is possible. It will trigger at 90% by default I believe.
You cannot run native Linux commands on a DD, it's not a Linux server - there is a lot of scope to allow you to do a lot but the reason DD is such a stable product is because the DDOS protects from too much 'Linux stuff' from people that 'know Linux'.
df -h is a Linux command - it's not available because it's not entirely relevant to a DD user.
'df' however is... but it's not a Unix "diskfree" command as you know it - it's a DDOS diskfree resume.
Basically, what you are asking for is not possible and not supported but is still possible to report on - as above.
regards, Jonathan
Jim-10
7 Posts
0
December 21st, 2015 15:00
I've got some scripts that do remote information gathering and alerting on DD via SSH but its not power shell. They are written in BASH for Linux.
Let me know if you are still interested?
Albatross30
1 Rookie
•
4 Posts
0
December 27th, 2015 09:00
Hi Karl,
Yes we are part of monitoring team and we have requirement that alert email should be triggered when it reaches to threshold value.
So from the Monitoring tool we are able to pull the df -h output to the windows box. So now my plan is to parse the file with powershell script and send automated email.
Any suggestions are appreciated.
Thanks
ble1
6 Operator
•
14.4K Posts
•
56.2K Points
0
December 28th, 2015 01:00
As you were told, this trigger already exists and it will send email alert (which is what you wanted in the first place) so you can skip extra monitoring here (you can also use snmp trap which should integrate with any reasonable monitoring tool). Machine does it for you so no need to complicate
If you still insist on doing double work, simply fire up df command (alias for filesys show space) and you can grab it/parse it via ssh which you can set via adminaccess command.
markbowytz
11 Posts
0
January 20th, 2016 08:00
While it's Perl and not Powershell, the basics apply with querying status via SNMP: datadomain-monitoring/check_datadomain at master · fatz/datadomain-monitoring · GitHub
We do our monitoring using DPA and it works fine, here's two considerations that came up for us:
1. If I get a "90% full" alert, I can't always reduce it quickly. After all - your DD isn't a file server. So, you'll get the 90% full for a while. Also, DPA gives trends so you can see that 90% coming before an auto email. (I used to be on our monitoring team, so I'm always in favor of some system giving me a graph than scripting it ;-)).
2. I believe, in some DD OS versions, SNMP is a single threaded process. If you're hitting it too frequently you can interrupt other systems that use SNMP to interrogate the DD (i.e. Avamar --> DD integration) as they might not get an answer in the time it expects.
PS-VCORE
8 Posts
0
February 2nd, 2016 08:00
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.
MIchal_Wilk
5 Posts
0
December 12th, 2016 07:00
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.
miralem1
1 Message
0
August 3rd, 2017 10:00
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
}
BlaneM
2 Posts
0
August 26th, 2021 09:00
Jim,
I am interested in obtaining these scripts. Looking to generate a CSV file containing information from DD CLI. specifically "user show list" that would identify users, when the logged in, where they logged in from as well as their last login. I can find my way around bash scripts.
Any assistance would be greatly appreciated
Thanks,
Mike Blaney (mike.blaney@dell.com)