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.
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)
- Collect VMAX SRP pool information from the management servers and save it to a CSV file
- 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)
- Generate output in CSV format and write to a file locally
- Using SSH / SCP send the file to Rundeck server
Script 2: (Shell)
- 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
- Creates a folder with current date insde archive folder
- Move previously generated CSV file to current date folder to avoid duplication of information
- Collate all CSV files copied from multiple management servers into one large CSV file
- Invoke next Python script
Script 3: (Python)
- Read CSV file and insert records to MySQL DB – Scheduled to run from @ Rundeck Server
Please find the sample output as under.
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