VMAX SRP Utilization Report & Upload to MySQL DB using Python

I had an opportunity to attend Python Basics Training imparted by Mr. Ashish Gulati. Ashish, a technology coach; was really good in explaining basics of language, data types and Pro & Cons of this language. The way he imparted knowledge was an unique experience. He was flexible to explain some of the real time use cases in data analytics, JSON, SSH connectivity etc.. and explained in detail about the various module’s functionality.

Thank much Ashish for the session, it was informative, very simple topics but effective learning experience, hands on coding was a big plus point. I have learned much that will assist me in my workplace. As an outcome, I have already started migrating from Perl to Python.  This blog is about my first attempt to write Python scripts @ work.

Scripts written in Python would run from several VMAX3 Enterprise Storage Management Servers located at various data centers.

Python_vmax_cap

There are 2 Python scripts and 1 Shell script which works in tandem to generate reports and insert information to MySQL DB. All three scripts are handled by Rundeck (Workflow + Scheduling)

Script 1: (Python)

  1. Collect VMAX SRP pool information from the management servers and save it to a CSV file
  2. Two SYMCLI commands are used to get capacity utilization information
    • symcfg list – List all the VMAX arrays managed by the server
    • symcfg -sid <SERIAL #> show -srp SRP_# – show SRP utilization details for the respective SRP (Storage Resource Pool)
  3. Generate output in CSV format and write to a file locally
  4. Using SSH / SCP send the file to Rundeck server

Script 2: (Shell)

  1. Shell script would push previously generated CSV file to an archive folder. Collate all the CSV files into one large CSV and call next Python script. – Scheduled to run from @ Rundeck Server
  2. Creates a folder with current date insde archive folder
  3. Move previously generated CSV file to current date folder to avoid duplication of information
  4. Collate all CSV files copied from multiple management servers into one large CSV file
  5. Invoke next Python script

Script 3: (Python)

  1. Read CSV file and insert records to MySQL DB – Scheduled to run from @ Rundeck Server

Please find the sample output as under.

Python_Output

Using the above base data from MySQL DB, we’d be generating dashboards, PDF reports and capacity trending charts using PHP.

If interested, please reach out to me to get these scripts. Stay Tuned for more updateson generating dashboards, PDF reports & capacity trending with PHP.

Thanks for stopping by… Please leave your comments / suggestions.

Disclaimers:

Image’s courtesy: images.google.com

6 thoughts on “VMAX SRP Utilization Report & Upload to MySQL DB using Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s