I made a little script last year to help me with a customer issue, and I had forgotten about it until I ran into the same problem.
The script converts the extracted TXT and XML files from the autosupport mail body.7z into the old format for use with Config Advisor.
But wait, Config Advisor doesn’t handle Cluster Mode systems with offline file imports. EXACTLY! It’s annoying, but if you just want to do a check on cabling or disk firmware versions, or see a config when a customer sends you an autosupport email with a body.7z in it, this will help you out!
If you have never heard of Config Advisor, it is a handy tool which you can have scan your Netapps to check if there are any cabling, disk, or software version issues. It’s not the end all be all, but for a super duper quick scan, it’s pretty darn useful.
It is supposed to just be for Netapp Partner and Employee use, so if you are not a PartnerPloyee, cover your eyes as you read the rest of this.
For this, you’ll need a real Terminal shell with bash and perl. Linux, OSX will “just work”. Windows users, get Cygwin. If you don’t ready use Cygwin, you need to use Cygwin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
#Step 1: #Extract body.7z to a new folder. # * OSX: Use Keka or If you have brew/port install 7z (brew install p7zip) # * Linux: 7z x body.7z # * Windows: I hate you. Just kidding. You can get 7z for Cygwin too. jk-47:tmp jkulm$ 7z x body.7z 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=utf8,Utf16=on,HugeFiles=on,8 CPUs) Processing archive: body.7z Extracting SYSCONFIG-A.txt Extracting SYSCONFIG-R.txt Extracting OPTIONS.txt Extracting software_image.xml Extracting CLUSTER-INFO.xml ... TRUNCATED ... TRUNCATED ... Extracting FAILED-DISK-REGISTRY.txt Extracting FC-DEVICE-MAP.txt Extracting FC-LINK-STATS.txt Extracting FC-STATS.txt Extracting PRIORITY-SHOW-VOLUME.txt Extracting var-etc-periodic-conf.txt Everything is Ok Files: 255 Size: 26233937 Compressed: 1381225 #Step 2: #Make all text type file names upper case # (this is one of many ways): perl -e 'for(@ARGV){rename$_,uc}' *.txt perl -e 'for(@ARGV){rename$_,uc}' *.xml # Replace underscores with DASHES perl -e 'do { (my $f = $_) =~ tr/_/-/; rename $_, $f } for glob "@ARGV"' *.XML perl -e 'do { (my $f = $_) =~ tr/_/-/; rename $_, $f } for glob "@ARGV"' *.TXT #Step 3: # Save my asupsections.txt to the directory. (This is just # headers and helps me call to the other files) wget http://www.jk-47.com/wp-content/uploads/2015/06/asupsections.txt jk-47:tmp jkulm$ wget http://www.jk-47.com/wp-content/uploads/2015/06/asupsections.txt --2015-06-16 10:05:31-- http://www.jk-47.com/wp-content/uploads/2015/06/asupsections.txt Resolving www.jk-47.com... 69.164.213.234 Connecting to www.jk-47.com|69.164.213.234|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5220 (5.1K) [text/plain] Saving to: 'asupsections.txt' 100%[=================================================================================================>] 5,220 --.-K/s in 0.03s 2015-06-16 10:05:31 (166 KB/s) - 'asupsections.txt' saved [5220/5220] |
Here is the asupsections.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#Step 4: #Run this: ASUPFILE="`grep X-Netapp-asup-hostname X-HEADER-DATA.TXT | awk '{print $2}'`_asup.txt" echo $ASUPFILE for i in `awk -F"===== " '{print $2}' asupsections.txt | awk -F" =====" '{print $1}'`; do echo "===== "$i" =====" >> $ASUPFILE ; cat $i.TXT >> $ASUPFILE; done ## It'll return lots of junk. Ignore that. ## See, this file was created. jk-47:tmp jkulm$ ls $ASUPFILE DR-NAPP-01_asup.txt |
Open up Config Advisor, select 7-mode (Yes I know this is a cluster mode system…), then select “Autosupport (from File)”.
Repeat this process for the other controller in the HA pair if you choose. Then click Collect Data. And Select the name it chooses.
BOOM!!! Done!
Awwwww yeah. I just saved you so much time in life. Now, go take a break.