Posting for some help again, I have a modified script that checks all the options of a master filer and checks target filers and show the differences, but Im struggling to get the excel to align properly for each of the options, does anyone know how to fix the formatting or is there an easier way to check a set of netapp filers against master filer through a script in perl or any other language any ideas welcome. The script is below and kinda works but half way down the options seem to get mixed up and misallgned not sure what Im doing wrong to be honest.
Ive tested it with mixed filer models and also with models that are all the same but it still doesnt work.
I just need to keep all the filers options the same like our master filer.
You might consider trying to isolate the part of the script that you are having the problem with. I'm not very familiar with excel, and that is a lot of code with confusing variable names (item, $item, $titem) to try to visually debug.
At the very least you could indicate what type of problem you are seeing or what the output is.
For example if you look at row 25 and 26 the 1440 value should be in row 26, the excel output (attached) seems to go out of sync later on in script output, rows 1-15 are fine and 19-29 have gone out of synch.
Any help would be appreciated. Its like the excel comes out of synch, you can run the script against a set of filers and see what I mean
I think you're problem is that you have different sets of options on your controllers. I'd use the "Get-NaOption -Hashtable" switch so you can simply lookup the option you need (whether it exists or not). Here's a really quick example to demonstrate the concept:
Thanks for all these ideas, ive tried the script where all the filers are the same so it ruled out there being different options/releases/models (they are the same to P release) ill still try a hashtable but think its the excel, the script actually detects if the targets differ from the master its just the excel is misalligned half way down the output. I would like to have it in an excel or text file so we can quickly see the differences for a number of filers and then I send it out to the admins via email. It was originally adopted from this script which only compared the autosupport options https://communities.netapp.com/docs/DOC-14848.
I liked the way the output was so I changed this script to run for all options, not sure if I need to make another adjustment to accomodate the script for all options I changed
$suppress = $Targops = get-naoption autosupport.*
to this $suppress = $Targops = get-naoption
So it would capture all of the options not just the autosupport options but not sure if something else needs changing Ive gone through it lots of times but cant see it.
It seems to work well if you only have the autosupport* in the script