Adai - That option eventspurgeinterval - it's set to 4 weeks. But that's not working in our production environment. What does that actually do, b/c If I do a dfm report events, I still see the data from April. So what exactly does that option do
... View more
Adai, The issue is that isn't scalable for the solution i'm looking for. So, what i need to do is your take your report, and create a date based object to do purging from. I have to get you involved with powershell man.. It's the ticket.. 🙂
... View more
Adai, Ok, that's show all the events... Now i will re-write the code to do the autoacknowledgement based on event report. So, basically, i'm writing powershell command to purge all events older than 7 days. Now the frustrating part is that you guys don't put the year for current year, so I have to create a date based object to handle this. Any chance on adding current year?
... View more
So, i'm just curious as why i don't see all the events when i dump dfm event list -q. When I open up the GUI dashboard and click events, I see events that aren't listed in dfm event list -q The reason why this is important to me is because i'm doing event based acknowledgement and deletion based on dates and the GUI is throwing me off. The CLI loks fine, Any comments would be great.
... View more
Beam is right... I tend to use get-navolsis and then use a math function to get what i'm looking for $sis = get-navolsis $name [System.Math]::Floor($sis.sizesaved/1gb)
... View more
So, if you guys don't have the luxury of a SAM or are just curious to gather all your IOM Shelf firmware, see the script below. There are prerequisites of a .csv file with a Filer title. I get this from an oncommand Dump. (i've written a script to do that in a previous post) So, the script will ask you to enter the filer list. Also, this script assumes you are using LDAP Authentication via CIFS to the filer. If you need to customize it for credentials, feel free. From the results of the script, I have another script that will globally update the shelves based on these results. This script is provided as is, but welcomes comments,updates, and/or suggestions. <# .SYNOPSIS Collects Shelf Firmware on filers .DESCRIPTION Collects Shelf firmware .EXAMPLE .\Shelf_firmware.ps1 .Notes .Author Josh Goldfarb #> Function main_block { ## Clear screen cls ## Starting Main # Importing input file $hosts = import-csv -path $inputfile $array = @() $hosts | % { $filer = $_.filer #$customobject = New-Object psobject #Add-Member -inputobject $customobject -membertype Noteproperty -name Filer -value $filer Write-Host "`nConnecting to filer:" $Filer Try { $c = connect-nacontroller $filer -erroraction "silentlycontinue" } catch { [system.exception] | Out-Null } # Check if connecting to filer if ($c -ne $null) { ### write-host "`n`t`t`tChecking Shelf Firmware on Filer:" $filer ## Gather Shelf information $Shelf = Get-NaShelf | ? {$_.type -like "*IOM*"} ## Check for $Null Object If ($Shelf -ne $Null) { # Create custom object ## Loop through shelves foreach ($s in $Shelf) { $customobject = New-Object psobject Add-Member -inputobject $customobject -membertype Noteproperty -name Filer -value $filer Add-Member -inputobject $customobject -membertype Noteproperty -name "Connected to filer" -value "Yes" Add-Member -inputobject $customobject -membertype Noteproperty -name "Shelves Present" -value "Yes" Add-Member -inputobject $customobject -membertype Noteproperty -name Name -value $S.name Add-Member -inputobject $customobject -membertype Noteproperty -name Status -value $S.status Add-Member -inputobject $customobject -membertype Noteproperty -name "type" -value $S.type Add-Member -inputobject $customobject -membertype Noteproperty -name FirmwareA -value $S.FirmwareRevA Add-Member -inputobject $customobject -membertype Noteproperty -name Firmwareb -value $S.FirmwareRevb $array += $customobject } } Else { Write-Host "`n`t`t`tFiler:" $filer "Does not have any IOM3 or IOM6 Shelves" $customobject = New-Object psobject Add-Member -inputobject $customobject -membertype Noteproperty -name Filer -value $filer Add-Member -inputobject $customobject -membertype Noteproperty -name "Connected to filer" -value "Yes" Add-Member -inputobject $customobject -membertype Noteproperty -name "Shelves Present" -value "NO" Add-Member -inputobject $customobject -membertype Noteproperty -name Name -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name Status -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name "type" -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name FirmwareA -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name Firmwareb -value "" $array += $customobject } } else { Write-Host "`n`t`t`tCould not connect to filer:" $filer $customobject = New-Object psobject Add-Member -inputobject $customobject -membertype Noteproperty -name Filer -value $filer Add-Member -inputobject $customobject -membertype Noteproperty -name "Connected to filer" -value "No" Add-Member -inputobject $customobject -membertype Noteproperty -name "Shelves Present" -value "NO" Add-Member -inputobject $customobject -membertype Noteproperty -name Name -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name Status -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name "type" -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name FirmwareA -value "" Add-Member -inputobject $customobject -membertype Noteproperty -name Firmwareb -value "" $array += $customobject } #$array += $customobject Clear-Variable c clear-variable filer } $2day = (get-date).tostring("MM-dd-yyyy-hh_mm") $array | Export-Csv c:\temp\shelfinformation_$2day.csv -NoTypeInformation $array | ft -autosize ### Close Main Function } cls $Host.UI.RAWUI.WindowTitle="Shelf Firmware Checker" If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { cls Write-Warning -Message "`nYou are attempting to execute this script in an non-elevated shell. This script requires to be run under Administrator priviledge. Please Re-launch Powershell as Administrator." "`n" "`n" Timeout /t -1 cls Exit } write-host "`n" $inputfile = read-host "Please enter an input file of a list of Filers you want to check Shelf Firmware on (i.e. c:\temp\filers.csv)" $fileloctest = test-path $inputfile If ($fileloctest -eq $false) { cls Write-Warning -Message "`nLocation of the file cannot be found. Please check the path of the file and re-execute. Exiting Script." "`n" "`n" Timeout /t -1 Exit } ## Clear screen cls $title = "Shelf Firmware Checker" $message = @" `nBefore the script executes we want to ensure that you have entered the proper information: `n `t`t`t`t`t`t`tThe input file you entered is: $inputfile `t`t`t`t`t`t`tInput File's path has been confirmed: $fileloctest `n `t`t`t`t`t`t`tIf these are both correct, please (P)roceed If this is not correct, please (e)xit "@ $proceed= New-Object System.Management.Automation.Host.ChoiceDescription "&Proceed", ` "(P)roceed with Shelf Firmware Check" $exit = New-Object System.Management.Automation.Host.ChoiceDescription "&exit", "Type exit or (E) to exit the script" $options = [System.Management.Automation.Host.ChoiceDescription[]]($proceed,$exit) $result = $host.ui.PromptForChoice($title, $message, $options, 1) switch ($result) { 0 { # Selected to proceed to password change main_block } 1 ## Exiting Script { Write-Host "`nYou have selected Exit`n" timeout /t -1 cls Exit } }
... View more
I've been down that road as well. I haven't had much luck in saving a report to a directory. The thought process was to save a report as a .csv and have script scoop it up. For now, I had to write a process that emails it to our DL and our offshore team saves the report.
... View more
Adai, OCUM doesnt do what this does out of the box. This script handles all the math and does predictive based capacity planning based on a 30day elastic growth trend. I should have provided instructions on how to run, so im sorry about that. Copy the script to your oncommand core server. Edit the script with notepad and at the bottom im piping csv fils and html files to a directory. Just change that to somewhere local so you can see how it runs. You can pm me your email and i can give you detailed screenshots. I cant post the.
... View more
$volume variable is an array, You need to pipe this array through a loop $volume | % { $name = $_.name write-host "Setting autodelete for volume: " $name set-NasnapshotAutodelete $name target_free_space 5 }
... View more
So, i know i've been asked many times regarding is it possible to build-out capacity management based on OnCommand. So, what I did is write a script that queries the aggregates and puts together growth rate numbers and then I did some calculation to figure out about how many days until your aggregate will reach 90%. I then pipe this to HTML headers and send it on it's way to a webserver for team review. The code is provided as is, and if you feel you can help build on it, either reply to the post or send me a PM. For our environment I skip Aggr0, b/c we don't use this for anything other than Ontap files and vfiler roots Hope this concept helps a lot of people. Thanks Josh
... View more
Adai, Ok, that's not scalable, especialy when supporting a global enviroment with 200+ filers. I never had the problem before running the NMC remotely for Performance Advisor. So what does Netapp Recommend for supporting a global enviroment if only one instance of NMC can be run with Performance Advisor running?
... View more
So, We have oncommand Core 5.1 on a huge physical server, 24 core, 32GB of ram, servicing 200 Filers, with Performance Advisor enabled on about 170 filers. PA data is currently 200GB+ When I launch the NMC directly from the server, PA is flying and I can move around the screens without issue. When I fire up the NMC and try to load PA from my desktop over a 1Gb connection it can barely work. All i'm presented with is a moving bar that goes back and forth. I'm wondering if the issue is either my desktop or there is something causing the WAN/LAN to affect the NMC. Any thoughts or suggestions are more than welcome. thx
... View more
Joel - What your doing will look good if you want to stare at the screen - But you do you really want to do that. Powershell is all about automation. You want to have this as a scheduled tasks that emails you a report. So, here's the basics. $globalarray = @() $filers | % { $filer = $_ $c = connet-nacontroller $filer $aggr = get-naaggr | ? {$_.SizePercentageUsed -gt 10} if ($aggr -ne $NUll) { $aggr | % { $customobject = new-object psobject Add-Member -inputobject $customobject -membertype Noteproperty -name filer -value $filer Add-Member -inputobject $customobject -membertype Noteproperty -name "Aggr" -value $_.name Add-Member -inputobject $customobject -membertype Noteproperty -name "total size" -value (convertto-formattednumber $_.totalsize datasize "0.0") Add-Member -inputobject $customobject -membertype Noteproperty -name "% used" -value (convertto-formattednumber $_.used percent) $globalarray += $customobject } } } $globalarray | ft -autosize $globalarray | export-csv c:\temp\aggrereport.csv -notypeinformation. Do some reading on custom objects and see if you can come up with sending this report to you..
... View more
The easiest thing to do here is to list them in a text file as stated above filer1 filer2 filer3 Then just do $filers = gc c:\filers.txt That will create the array Then just put that array into a loop $filers | % { $c = connect-nacontroller $_ Put code here } Also, you are doing something wrong in my opinion. You need to put your where clause before your select statement. Get-Naaggr | ? {$_.SizePercentageUsed -gt 90}| select homename, SizePercentageUsed, name | | ft -AutoSize
... View more
I tend to lean more towards switch statements as well in this nstance. Switch ( $ans ) { 0 { volincrease} 1 { Write-Host "`nYou have selected Exit`n" timeout /t -1 cls Exit } }
... View more