Reporting on Clariion / VNX Block Storage Pool capacity with a bash script

I recently added a post about how to report on Celerra & VNX File pool sizes with a bash script. I’ve also been doing that for a long time with our Clariion and VNX block pools so I thought I’d share that information as well.

I use a cron job to schedule the report daily and copy it to our internal web server. I then run the csv2html.pl perl script (from http://www.jpsdomain.org/source/perl.html) to convert it to an HTML output file to add to our intranet report page. This is likely the most viewed report I create on a daily basis as we always seem to be running low on available capacity.

The output of the script looks similar to this:

PoolReport

Here is the bash script that creates the report:

TODAY=$(date)
#Add the current time/date stamp to the top of the report 
echo $TODAY > /scripts/PoolReport.csv

#Create a file with the standard navisphere CLI output for each storage pool (to be processed later into the format I want)

naviseccli -h VNX_1 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_0.csv

naviseccli -h VNX_1 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_1.csv

naviseccli -h VNX_1 storagepool -list -id 2 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_2.csv

naviseccli -h VNX_1 storagepool -list -id 3 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_3.csv

naviseccli -h VNX_1 storagepool -list -id 4 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_6.csv

#

naviseccli -h VNX_2 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_4.csv

naviseccli -h VNX_2 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_5.csv

naviseccli -h VNX_2 storagepool -list -id 2 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_7.csv

naviseccli -h VNX_2 storagepool -list -id 3 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_8.csv

#

Naviseccli -h VNX_3 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site1_6.csv

#

naviseccli -h VNX_4 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site2_0.csv

naviseccli -h VNX_4 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site2_1.csv

naviseccli -h VNX_4 storagepool -list -id 2 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site2_2.csv

naviseccli -h VNX_4 storagepool -list -id 3 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site2_3.csv

#

naviseccli -h VNX_5 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site2_4.csv

#

naviseccli -h VNX_6 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site3_0.csv

naviseccli -h VNX_6 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site3_1.csv

#

naviseccli -h VNX_7 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site3_0.csv

naviseccli -h VNX_7 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site3_1.csv

#

naviseccli -h VNX_8 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site4_0.csv

naviseccli -h VNX_8 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site4_1.csv

#

naviseccli -h VNX_9 storagepool -list -id 0 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site5_0.csv

naviseccli -h VNX_9 storagepool -list -id 1 -availableCap -consumedCap -UserCap -prcntFull >/scripts/report_site5_1.csv

#

#Create a new file for each site's storage pool (from the file generated in the previous step) hat contains only the info that I want.

#

cat /scripts/report_site1_4.csv | grep Name > /scripts/Site1Pool4.csv

cat /scripts/report_site1_4.csv | grep GBs >>/scripts/Site1Pool4.csv

cat /scripts/report_site1_4.csv | grep Full >>/scripts/Site1Pool4.csv

#

cat /scripts/report_site1_5.csv | grep Name > /scripts/Site1Pool5.csv

cat /scripts/report_site1_5.csv | grep GBs >>/scripts/Site1Pool5.csv

cat /scripts/report_site1_5.csv | grep Full >>/scripts/Site1Pool5.csv

#

cat /scripts/report_site1_0.csv | grep Name > /scripts/Site1Pool0.csv

cat /scripts/report_site1_0.csv | grep GBs >>/scripts/Site1Pool0.csv

cat /scripts/report_site1_0.csv | grep Full >>/scripts/Site1Pool0.csv

#

cat /scripts/report_site1_1.csv | grep Name > /scripts/Site1Pool1.csv

cat /scripts/report_site1_1.csv | grep GBs >;;>;;/scripts/Site1Pool1.csv

cat /scripts/report_site1_1.csv | grep Full >;;>;;/scripts/Site1Pool1.csv

#

cat /scripts/report_site1_2.csv | grep Name > /scripts/Site1Pool2.csv

cat /scripts/report_site1_2.csv | grep GBs >>/scripts/Site1Pool2.csv

cat /scripts/report_site1_2.csv | grep Full >>/scripts/Site1Pool2.csv

#

cat /scripts/report_site1_7.csv | grep Name > /scripts/Site1Pool7.csv

cat /scripts/report_site1_7.csv | grep GBs >>/scripts/Site1Pool7.csv

cat /scripts/report_site1_7.csv | grep Full >>/scripts/Site1Pool7.csv

#

cat /scripts/report_site1_8.csv | grep Name > /scripts/Site1Pool8.csv

cat /scripts/report_site1_8.csv | grep GBs >>/scripts/Site1Pool8.csv

cat /scripts/report_site1_8.csv | grep Full >>/scripts/Site1Pool8.csv

#

cat /scripts/report_site1_3.csv | grep Name > /scripts/Site1Pool3.csv

cat /scripts/report_site1_3.csv | grep GBs >>/scripts/Site1Pool3.csv

cat /scripts/report_site1_3.csv | grep Full >>/scripts/Site1Pool3.csv

#

cat /scripts/report_site1_6.csv | grep Name > /scripts/Site1Pool6.csv

cat /scripts/report_site1_6.csv | grep GBs >>/scripts/Site1Pool6.csv

cat /scripts/report_site1_6.csv | grep Full >>/scripts/Site1Pool6.csv

#

cat /scripts/report_site1_6.csv | grep Name > /scripts/Site1Pool6.csv

cat /scripts/report_site1_6.csv | grep GBs >>/scripts/Site1Pool6.csv

cat /scripts/report_site1_6.csv | grep Full >>/scripts/Site1Pool6.csv

#

cat /scripts/report_site2_0.csv | grep Name > /scripts/Site2Pool0.csv

cat /scripts/report_site2_0.csv | grep GBs >>/scripts/Site2Pool0.csv

cat /scripts/report_site2_0.csv | grep Full >>/scripts/Site2Pool0.csv

#

cat /scripts/report_site2_1.csv | grep Name > /scripts/Site2Pool1.csv

cat /scripts/report_site2_1.csv | grep GBs >>/scripts/Site2Pool1.csv

cat /scripts/report_site2_1.csv | grep Full >>/scripts/Site2Pool1.csv

#

cat /scripts/report_site2_2.csv | grep Name > /scripts/Site2Pool2.csv

cat /scripts/report_site2_2.csv | grep GBs >>/scripts/Site2Pool2.csv

cat /scripts/report_site2_2.csv | grep Full >>/scripts/Site2Pool2.csv

#

cat /scripts/report_site2_3.csv | grep Name > /scripts/Site2Pool3.csv

cat /scripts/report_site2_3.csv | grep GBs >>/scripts/Site2Pool3.csv

cat /scripts/report_site2_3.csv | grep Full >>/scripts/Site2Pool3.csv

#

cat /scripts/report_site2_4.csv | grep Name > /scripts/Site2Pool4.csv

cat /scripts/report_site2_4.csv | grep GBs >>/scripts/Site2Pool4.csv

cat /scripts/report_site2_4.csv | grep Full >>/scripts/Site2Pool4.csv

#

cat /scripts/report_site3_0.csv | grep Name > /scripts/Site3Pool0.csv

cat /scripts/report_site3_0.csv | grep GBs >>/scripts/Site3Pool0.csv

cat /scripts/report_site3_0.csv | grep Full >>/scripts/Site3Pool0.csv

#

cat /scripts/report_site3_1.csv | grep Name > /scripts/Site3Pool1.csv

cat /scripts/report_site3_1.csv | grep GBs >>/scripts/Site3Pool1.csv

cat /scripts/report_site3_1.csv | grep Full >>/scripts/Site3Pool1.csv

#

cat /scripts/report_site3_0.csv | grep Name > /scripts/Site4Pool0.csv

cat /scripts/report_site3_0.csv | grep GBs >>/scripts/Site4Pool0.csv

cat /scripts/report_site3_0.csv | grep Full >>/scripts/Site4Pool0.csv

#

cat /scripts/report_site3_1.csv | grep Name > /scripts/Site4Pool1.csv

cat /scripts/report_site3_1.csv | grep GBs >>/scripts/Site4Pool1.csv

cat /scripts/report_site3_1.csv | grep Full >>/scripts/Site4Pool1.csv

#

cat /scripts/report_site4_0.csv | grep Name > /scripts/Site5Pool0.csv

cat /scripts/report_site4_0.csv | grep GBs >>/scripts/Site5Pool0.csv

cat /scripts/report_site4_0.csv | grep Full >>/scripts/Site5Pool0.csv

#

cat /scripts/report_site4_1.csv | grep Name > /scripts/Site5Pool1.csv

cat /scripts/report_site4_1.csv | grep GBs >>/scripts/Site5Pool1.csv

cat /scripts/report_site4_1.csv | grep Full >>/scripts/Site5Pool1.csv

#

cat /scripts/report_site5_0.csv | grep Name > /scripts/Site6Pool0.csv

cat /scripts/report_site5_0.csv | grep GBs >>/scripts/Site6Pool0.csv

cat /scripts/report_site5_0.csv | grep Full >>/scripts/Site6Pool0.csv

#

cat /scripts/report_site5_1.csv | grep Name > /scripts/Site6Pool1.csv

cat /scripts/report_site5_1.csv | grep GBs >>/scripts/Site6Pool1.csv

cat /scripts/report_site5_1.csv | grep Full >>/scripts/Site6Pool1.csv

#

#The last section creates the final output for the report before it is processed into an html table. It creates a single line for each storage pool with the total GB available, total GB used, available GB, and the percent utilization of the pool.

#

echo 'Pool Name','Total GB ','Used GB ','Available GB ','Percent Full ' >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool2.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool2.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool2.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool2.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool2.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool3.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool3.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool3.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool3.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool3.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool6.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool6.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool4.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool4.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool4.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool4.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool4.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool5.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool5.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool5.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool5.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool5.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool7.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool7.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool7.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool7.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool7.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site1Pool8.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool8.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool8.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool8.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool8.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site1Pool6.csv |awk '{print $3}'`","`grep -i User /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Available /scripts/Site1Pool6.csv |awk '{print $4}'`","`grep -i Full /scripts/Site1Pool6.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site2Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site2Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site2Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site2Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site2Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site2Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site2Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site2Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site2Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site2Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site2Pool2.csv |awk '{print $3}'`","`grep -i User /scripts/Site2Pool2.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site2Pool2.csv |awk '{print $4}'`","`grep -i Available /scripts/Site2Pool2.csv |awk '{print $4}'`","`grep -i Full /scripts/Site2Pool2.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site2Pool3.csv |awk '{print $3}'`","`grep -i User /scripts/Site2Pool3.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site2Pool3.csv |awk '{print $4}'`","`grep -i Available /scripts/Site2Pool3.csv |awk '{print $4}'`","`grep -i Full /scripts/Site2Pool3.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site2Pool4.csv |awk '{print $3}'`","`grep -i User /scripts/Site2Pool4.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site2Pool4.csv |awk '{print $4}'`","`grep -i Available /scripts/Site2Pool4.csv |awk '{print $4}'`","`grep -i Full /scripts/Site2Pool4.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site3Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site3Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site3Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site3Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site3Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site3Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site3Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site3Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site3Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site3Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site4Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site4Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site4Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site4Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site4Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site4Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site4Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site4Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site4Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site4Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site5Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site5Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site5Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site5Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site5Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site5Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site5Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site5Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site5Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site5Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#

echo " ",'Total GB','Used GB','Available GB','Percent Full' >> /scripts/PoolReport.csv

#

#

echo `grep Name /scripts/Site6Pool0.csv |awk '{print $3}'`","`grep -i User /scripts/Site6Pool0.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site6Pool0.csv |awk '{print $4}'`","`grep -i Available /scripts/Site6Pool0.csv |awk '{print $4}'`","`grep -i Full /scripts/Site6Pool0.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

echo `grep Name /scripts/Site6Pool1.csv |awk '{print $3}'`","`grep -i User /scripts/Site6Pool1.csv |awk '{print $4}'`","`grep -i Consumed /scripts/Site6Pool1.csv |awk '{print $4}'`","`grep -i Available /scripts/Site6Pool1.csv |awk '{print $4}'`","`grep -i Full /scripts/Site6Pool1.csv |awk '{print $3}'` >> /scripts/PoolReport.csv

#

#Convert the file to HTML for use on the internal web server 

#

./csv2htm.pl -e -T -i /scripts/PoolReport.csv -o /webfolder/PoolReport.html
Advertisements

20 thoughts on “Reporting on Clariion / VNX Block Storage Pool capacity with a bash script”

  1. @emcsan – your blog posts are very helpful, thank you.

    Is there a command for calculating the total capacity of the array (block)?

    1. Thanks, glad you’ve found it helpful. There isn’t a command that will give you total capacity that I’m aware of, you’ll have to do it per storage pool (or raid group) and add up the totals.

  2. is there a way to do the last part in windows using command line or powershell? for all intents and purposes, linux is frowned upon in my environment and i am not familiar enough with the awk feature

    1. I use Cygwin installed on a Windows server for my bash scripts, I don’t have a linux server either. I initially did that because I couldn’t find specific batch commands in Windows that had the same functionality as in bash. I’ve never used Powershell. For the unix specific commands like grep and awk you could try the open source unix tools for windows (http://unxutils.sourceforge.net/) or Cygwin (https://www.cygwin.com/). Scripts in cygwin can be called from the windows scheduler, the syntax is ‘c:\cygwin\bin\bash.exe -l -c “/home/scripts/script.sh”‘. You could also use ActivePerl for Windows for the csv2html conversion utility (http://www.activestate.com/activeperl). Sorry I can’t be of more help with windows scripting, I’m just not as familiar with it.

      1. i have cygwin installed on my pc now and run the report upto the final part. echo ‘Pool Name’,’Total GB ‘,’Used GB ‘,’Available GB ‘,’Percent Full ‘ >> /scripts/PoolReport.csv

        #

        echo `grep Name /home/site_gf.csv |awk ‘{print $3}’`”,”`grep -i User /home/site_gf.csv |awk ‘{print $4}’`”,”`grep -i Consumed /home/site_gf.csv |awk ‘{print $4}’`”,”`grep -i Available /home/site_gf.csv |awk ‘{print $4}’`”,”`grep -i Full /home/site_gf.csv |awk ‘{print $3}’` >> /home/aaa.csv
        awk: cmd. line:1: ‘{print
        awk: cmd. line:1: ^ invalid char ‘¦’ in expression
        awk: cmd. line:1: ‘{print
        awk: cmd. line:1: ^ invalid char ‘¦’ in expression
        awk: cmd. line:1: ‘{print
        awk: cmd. line:1: ^ invalid char ‘¦’ in expression
        awk: cmd. line:1: ‘{print
        awk: cmd. line:1: ^ invalid char ‘¦’ in expression
        awk: cmd. line:1: ‘{print
        awk: cmd. line:1: ^ invalid char ‘¦’ in expression

        my issue is with not being able to print horizontally, i can get it to print vertically but that isnt what you have listed any thoughts

        1. It looks like a syntax issue. I can see in the command you have a “vertical bar” character ( | ), and in the output it shows a “broken bar” character ( ¦ ). Also, in front
          of the “{print” command you have a quote mark ( ‘ ) rather than an apostrophe ( ‘ ). If the awk commands don’t function your output will not go on the same line horizontally.
          Use the Pipe and the Apostrophe and it should work for you.

          Here are the windows alt codes I referenced:

          ¦ – Broken Bar – Alt+0166
          | – Pipe – Alt+0124

          ‘ – Apostrophe – Alt+0039
          ‘ – curly single open quote – Alt+0145
          ’ – curly single close quote – Alt+0146

          Here’s how to use windows alt codes:

          1. Place your cursor in the location where you wish to insert a special character.
          2. Activate the numeric key pad on the right of the keyboard by pressing Num Lock.
          3. While pressing down the ALT key, type the four-digit code on the numeric key pad at the right edge of the keyboard.

  3. thanks for your scrpt, seems useful , let me try ..but i dont have this script csv2htm.pl .. pls help me to find out this pl script

  4. Hi – Your scripts seems awesome and which what i have been looking for it implement.

    Could you please guide me whether can it be run over Windows servers or Linux as my VNX boxes are being accessed from Windows servers.

    And please do let me know the Pre-requisites to initiate the script to run.

    Thanks in Advance.

    1. Hi Satish,

      All of the bash scripts on this blog were written to be used with Cygwin installed on a Windows Server, however all should work fine in Linux as well. If you’re not familiar with it, Cygwin is a free Unix-like environment and command-line interface for Windows. It provides native integration of Windows-based applications, data, and other system resources with applications, software tools, and data of the Unix-like environment, and I use it extensively for the extra functionality provided by native unix scripting commands vs. the limited capabilities of standard windows batch files. If you’d like to use the perl script that converts the csv output to an html table, you’ll need to install a perl distribution on the windows server as well. I used ActiveState Perl. That should be the only prerequisite.

  5. Hi,

    Thank you for the scripts, I benefited to meet my requirement.

    We’ve VNX 5700 with Raid Groups configured but not Pools. All Output will be in Block Size. One can convert Blocks into MB or GB easliy and finally use /csv2html.pl script that this site has.

    So I’m putting these lines for anyone’s reference, because sharing is caring :). My script is work of 5-8 hours with little bash knowledge, so some of you can find it stupid enough to improvise

    NOTE – I’ve put the script named vnx_pool.sh under the path – /opt/Navisphere/bin/scripts. All Raid Group files will be created in the same location. The script can be easily added in crontab for schedules

    NOTE – Copy the script lines in N++ to visualize proper formatting
    ==========================
    SERVERNAME:/opt/Navisphere/bin/scripts # cat vnx_pool.sh
    #Record todays Date
    TODAY=$(date)

    ##Add the current time/date stamp to the top of the report
    echo $TODAY>/opt/Navisphere/bin/scripts/PoolReport.csv

    #Remove Old or Previous Files [The very first time , rm commands may through error, please ignore]
    cd /opt/Navisphere/bin/scripts
    rm RG* #Remove any file whose name is starting with RG
    rm Filter* #Remove any file whose name is starting with Filter*

    #Set Environmental Variable for Naviseccli commands to be run
    cd /opt/Navisphere/bin

    #List the ArrayName – YOURARRAYNAME
    ./naviseccli -user sysadmin -password sysadmin -scope 0 -h 10.243.95.xxx arrayname >> /opt/Navisphere/bin/scripts/PoolReport.csv
    echo ‘RaidGroup ID’,’Total Raw Capacity’,’Used Capacity’,’Available Capacity’ >> /opt/Navisphere/bin/scripts/PoolReport.csv

    #List Standard Pool/RAID Group details using for loop [Like I said we’ve RAID Groups configured, so I’m listing all RG Numbers in for loop]

    for k in 1 2 3 4 5 6 7 8 9 496 497 498 499
    do
    ./naviseccli -user sysadmin -password sysadmin -scope 0 -h 10.243.95.xxx getrg $k >> /opt/Navisphere/bin/scripts/RG$k.csv

    #Filter Required RG details into the file Filter_RKx
    cat /opt/Navisphere/bin/scripts/RG$k.csv | grep ID: > /opt/Navisphere/bin/scripts/Filter_RG$k.csv
    cat /opt/Navisphere/bin/scripts/RG$k.csv | grep Raw >> /opt/Navisphere/bin/scripts/Filter_RG$k.csv
    cat /opt/Navisphere/bin/scripts/RG$k.csv | grep Logical >> /opt/Navisphere/bin/scripts/Filter_RG$k.csv
    cat /opt/Navisphere/bin/scripts/RG$k.csv | grep non-contiguous >> /opt/Navisphere/bin/scripts/Filter_RG$k.csv

    echo `grep ID: /opt/Navisphere/bin/scripts/Filter_RG$k.csv |awk ‘{print $3}’`,`grep Raw /opt/Navisphere/bin/scripts/Filter_RG$k.csv |awk ‘{print $4}’`,`grep Logical /opt/Navisphere/bin/scripts/Filter_RG$k.csv |awk ‘{print $4}’`,`grep Free /opt/Navisphere/bin/scripts/Filter_RG$k.csv |awk ‘{print $4}’` >> /opt/Navisphere/bin/scripts/PoolReport.csv
    done
    exit 0
    ========================================
    OUTPUT OF GENERATED FILES WILL LOOK SOMETHING LIKE THIS

    SERVERNAME:/opt/Navisphere/bin/scripts # ls -ltr
    total 128
    -rwxr-xr-x 1 root root 1688 Jul 1 10:51 vnx_pool.sh
    -rw-r–r– 1 root root 1462 Jul 1 10:51 RG1.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG1.csv
    -rw-r–r– 1 root root 1472 Jul 1 10:51 RG2.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG2.csv
    -rw-r–r– 1 root root 1471 Jul 1 10:51 RG3.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG3.csv
    -rw-r–r– 1 root root 1474 Jul 1 10:51 RG4.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG4.csv
    -rw-r–r– 1 root root 1488 Jul 1 10:51 RG5.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG5.csv
    -rw-r–r– 1 root root 2124 Jul 1 10:51 RG6.csv
    -rw-r–r– 1 root root 208 Jul 1 10:51 Filter_RG6.csv
    -rw-r–r– 1 root root 2121 Jul 1 10:51 RG7.csv
    -rw-r–r– 1 root root 208 Jul 1 10:51 Filter_RG7.csv
    -rw-r–r– 1 root root 1786 Jul 1 10:51 RG8.csv
    -rw-r–r– 1 root root 209 Jul 1 10:51 Filter_RG8.csv
    -rw-r–r– 1 root root 1430 Jul 1 10:51 RG9.csv
    -rw-r–r– 1 root root 210 Jul 1 10:51 Filter_RG9.csv
    -rw-r–r– 1 root root 963 Jul 1 10:51 RG496.csv
    -rw-r–r– 1 root root 200 Jul 1 10:51 Filter_RG496.csv
    -rw-r–r– 1 root root 963 Jul 1 10:51 RG497.csv
    -rw-r–r– 1 root root 200 Jul 1 10:51 Filter_RG497.csv
    -rw-r–r– 1 root root 964 Jul 1 10:51 RG498.csv
    -rw-r–r– 1 root root 200 Jul 1 10:51 Filter_RG498.csv
    -rw-r–r– 1 root root 961 Jul 1 10:52 RG499.csv
    -rw-r–r– 1 root root 198 Jul 1 10:52 Filter_RG499.csv
    -rw-r–r– 1 root root 563 Jul 1 10:52 PoolReport.csv

    #Convert the file PoolReport.csv to HTML for use on the internal web server
    #
    ./csv2htm.pl -e -T -i /scripts/PoolReport.csv -o /webfolder/PoolReport.html

  6. Hello Sanguy,

    ./csv2htm.pl -e -T -i /reports/clariion3_hostname.report.csv -o /reports/clariion3_hostname.report.html

    Do you always place this ./csv2htm.pl in the same location where clariion3_hostname.report.csv is located/generated?

    1. Yes, I always place a copy of the csv2html.pl file in the same root directory as the script, which in my case is also the same directory that the reports are generated.

      1. You probably not need perl script, which is overhead for shell users to learn perl scripting [if not just make use of it]

        I found simple shell script that converts csv to html. It is working for internally here.

        The OUTPUT on HTML page looks something like this [in table format]

        Mon Jul 10 21:50:02 CDT 2017
        Array Name: VNXARRAYNAME
        RaidGroup ID Total Raw Capacity Used Capacity Available Capacity
        1 30740234240 15370117120 690053120
        2 30740234240 15370117120 1109483520
        3 30740234240 15370117120 1109483520
        4 30740234240 15370117120 1109483520
        5 30740234240 15370117120 5303787520
        6 30740234240 15370117120 270622720
        7 30740234240 15370117120 270622720
        8 30740234240 15370117120 7317053440
        9 30745034752 30745034752 30745034752
        496 3841669120 3841669120 0
        497 3841669120 3841669120 0
        498 3841669120 3841669120 0
        499 558854144 558854144 0

        Here is the script for

        SERVERNAME:/opt/Navisphere/bin/scripts # more csv2html.sh
        awk
        ‘BEGIN{
        FS=”,”
        #print “MIME-Version: 1.0”
        #print “Content-Type: text/html”
        #print “Content-Disposition: inline”
        print “””Heading1Heading2Heading3”
        }
        {
        printf “”
        for(i=1;i<=NF;i++)
        printf "%s”, $i
        print “”
        }
        END{
        print “”
        }

        /opt/Navisphere/bin/scripts/VNX/PoolReport.csv > /opt/Navisphere/bin/scripts/VNX/PoolReport.html

Leave a Reply