PureStorage-OpenConnect / powershell-toolkit

The Pure Storage PowerShell Toolkit provides a number of different cmdlets ranging from core Windows Server, WMI, WSMAN, & .NET assemblies. The intention of the toolkit is to provide a library for customers and the Pure Storage field to use in troubleshooting, FlashArray reporting & other useful scenarios.
Apache License 2.0
22 stars 6 forks source link

Pure Storage Health Report #25

Open lesauska opened 6 years ago

lesauska commented 6 years ago

Hi,

I am looking for some help related to Pure storage health check reporting using power shell script. Please share the script if you have any...

Thanks in Advance...

Regards, Lesauska

barkz commented 6 years ago

Hi Lesauska -

What details are you looking for in the report?

Thx, Barkz

lesauska commented 6 years ago

Hi Barkz,

Thank you for the quick reply. We want to know if the controllers are healthy, any hardware failure like disk, ports and so on.

This was the script developed on your input

$secpasswd = ConvertTo-SecureString "Password" -AsPlainText -Force

$mycreds = New-Object System.Management.Automation.PSCredential ("User ID", $secpasswd)

New-FlashArrayCapacityReport -Credential $mycreds -EndPoint XX.XX.XX.XX -OutFilePath C:\Temp -HTMLFileName ODCPSM7N011F-Report.html

Start-Sleep -s 15

New-FlashArrayCapacityReport -Credential $mycreds -EndPoint XX.XX.XX.XX -OutFilePath C:\Temp -HTMLFileName ODCPSM7N00F6-Report.html

Start-Sleep -s 15

New-FlashArrayCapacityReport -Credential $mycreds -EndPoint XX.XX.XX.XX -OutFilePath C:\Temp -HTMLFileName PDCPSM7P00CE-Report.html

Start-Sleep -s 15

New-FlashArrayCapacityReport -Credential $mycreds -EndPoint XX.XX.XX.XX -OutFilePath C:\Temp -HTMLFileName ODCPSX7P0066-Report.html

Start-Sleep -s 15

New-FlashArrayCapacityReport -Credential $mycreds -EndPoint XX.XX.XX.XX -OutFilePath C:\Temp -HTMLFileName ODCPSX7P0067-Report.html

Start-Sleep -s 15

(Get-Content "C:\Temp\ODCPSM7N011F-Report.html") + (Get-Content "C:\Temp\ODCPSM7N00F6-Report.html") + (Get-Content "C:\Temp\PDCPSM7P00CE-Report.html") + (Get-Content "C:\Temp\ODCPSX7P0066-Report.html") + (Get-Content "C:\Temp\ODCPSX7P0067-Report.html") | Set-Content "C:\TEMP\Pure_Capacity_Report.html"

$body = Get-Content C:\temp\Pure_Capacity_Report.html -Raw

Send-MailMessage -From "kalyan kalyan.guturi@XXXX.com" -To "kalyan

kalyan.guturi@XXXX.com" -Subject "report 1" -Body $body -BodyAsHtml -SmtpServer "XX.XX.XX.XX"

Thanks, Kalyan Guturi.

On Tue, Jul 17, 2018 at 12:46 AM, barkz notifications@github.com wrote:

Hi Lesauska -

What details are you looking for in the report?

Thx, Barkz

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PureStorage-OpenConnect/powershell-toolkit/issues/25#issuecomment-405351177, or mute the thread https://github.com/notifications/unsubscribe-auth/AnNb6EN7g9zk6ra6as7Tiqg3RpcKusSWks5uHOaOgaJpZM4VK_55 .