Is your script/code looks dull and not in order? If yes, then its time to use pycodestyle!! Pycodestyle (formerly known as PEP8) is a syntax and style checker tool for Python language. In this blog, I’ve documented step by step procedure to install this with … Continue reading Pycodestyle @ Sublime Text
Netmiko is a simplified module to manage Network devices via SSH. This module is developed by Kirk Byers. I would recommend all network engineers to learn and equip this module to automate day to day configuration tasks.
I’ve written a demo script to disable SNMP Server’s “globalenforcepriv” on both Cisco IOS and Nexus switches. Using this script we could make the necessary changes on 100’s of switches in few minutes saving time and energies of network engineers.
Al Sweigart wrote a book called ‘Automate boring stuff using python’. This is one of the scripts which could help network engineers to automate monotonous tasks using Python and Netmiko module.
In VMAX3 or any enterprise-class storage arrays, hot spares are used to replace failing or failed disks in the storage array. Hot Spare drives need to be of the same configuration and size (can be larger) as that of the failing/failed disk. VMAX3 with Hypermax use Direct Sparing to automatically replace a failing disk. Please click here to know more…
This script would fetch hot spare drives count per VMAX3 array and generates a dash. This dash shows compliance report across all DCs.
What does this Brocade SAN switch automated troubleshooting script do?
- Ping the SAN switch IPs and check the connectivity
- Perform basic health check by running switchstatusshow command
- Check for CRC and EncOut errors by running porterrshow command
- If there are CRC and EncOut errors it clears the port statistics and wait for 20 minutes to monitor the incremental errors on the switch ports using portstatsclear and portshow commands
- Check and compare Lr_in & Ols_Out and Lr_out and Ols_in values to detect faulty cable and SFP issue
- Generate supportsave files which is required to do further analysis or troubleshooting by switch vendor and FTP the files
- Capture all the above output to file and generate email alert to further engage an engineer to continue troubleshooting or log a case with switch vendor
I hope this would help us in proactively monitoring SAN switches and iron out false positives without human intervention.
To download the script please click here and select ‘Brocade Troubleshooting’ from the right pane under Topics.
I believe this could be last blog post of the year 2016…
Belated Merry Christmas and Wish you Happy and Prosperous New Year 2017 in advance to all my followers, readers and visitors!!
How to hide your important files from people without making Hidden folders
1. Go to Desktop and create a new folder
2. Name the folder Internet Explorer
3. Change the folder icon to Internet Explorer
4. Keep it in a corner of the desktop
Now, no one will open internet explorer 😀
This blog is being written as a companion to my previous blog on Automated EMC VMAX Capacity Reporting
In recent times, we’re asked to develop scripts to capture performance metrics from EMC VMAX storage. There is a ‘symstat’ command with many attributes to capture performance metrics information from the array. But this command was not fulfilling all our requirements. While exploring various options and consultation with EMC support / community we decided to try Unisphere / RESTAPI.
So far I was using Perl as THE LANGUAGE to talk to my storage arrays. But I was forced to switch over to Python which works best with REST API / JSON. Additionally, there are lots of code out there on RESTAPI written in Python. So it is easy to ‘get inspired’ by those codes and write customized code for our requirements. So this would make me yet another ‘Pythonistas’ 🙂
This is my first ever Python (version 2.7 on GNU/Debian Linux) script to capture EMC VMAX Performance Metrics retrieved from Unisphere for VMAX (version 8.2) via RESTAPI. I’ve referred this Python script to develop custom script to suit our requirements. Many thanks to Matt Cowger (mcowger) for sharing the script in Github.
There are plenty of metrics that can be captured using this script but I’ve written a simple code for demo purpose to print few metrics in CSV format which can be either imbibed by excel for further reporting / charting or injected to MySQL DB to do many stuffs…
Here is the sample + cropped output for reference. In the below table timestamp (column B) is in epoch format which is converted to MYSQL datetime format via INSERT query
P.S: I’ve changed VMAX serial number for various factors
If interested, please reach out to me to get these Python scripts.
Image Courtesy: https://www.emc.com
Thanks for stopping by… Please leave your comments / suggestions.
Storage capacity reporting has become a tedious task these days unless we don’t have tools in place. These tools are not as cheap we can think of. There are additional layers added to it to hype and increase its value in market. But if customer ask a storage admin to run the report manually then its a nightmare for the admins.
We always want to go by the easy way which means GUI / EMC Unisphere but for reporting this doesn’t helps to customize and fulfill the customer requirements . EMC SYMCLI / Solutions Enabler can be used effectively here to address this issue. We can use SYMCLI to automate these manual reports. By means of automation, we can ensure quality, timely and error-free reports are generated which can be scheduled via CRON or Tasks Scheduler to send it directly to the stakeholders. SYMCLI built-in supports XML formatted output of the commands which would become easier to parse the information using XML supported programming language.
I’ve developed PERL scripts to generate Storage Pool capacity and Disk capacity report for multiple VMAX storage arrays which are managed from the SYMCLI / Solutions Enabler server. Following are the benefits of using this script.
1. Generates Pool capacity report for all storage arrays which has columns – SYM ID,MODEL,TOTAL USABLE POOL CAPACITY TB,TOTAL USED POOL CAPACITY TB,TOTAL FREE POOL CAPACITY TB, TOTAL POOL UTILIZATION %, TOTAL POOL SUBSCRIBED %
2. Generates Disk capacity report for all storage arrays which has columns – SYM ID,MODEL,TOTAL EFD,TOTAL FC_SAS,TOTAL SATA_NLSAS,FORMATTED EFD CAPACITY GB,FORMATTED FC_SAS CAPACITY GB,FORMATTED SATA_NLSAS CAPACITY GB, TOTAL FORMATTED CAPACITY GB, UNFORMATTED EFD CAPACITY GB,UNFORMATTED FC_SAS CAPACITY GB,UNFORMATTED SATA_NLSAS CAPACITY GB,TOTAL UNCONFIGURED CAPACITY GB,TOTAL UNFORMATTED CAPACITY GB
Output generated from the scripts will be in the form of CSV format. This is information can be plugged into desired format and generate reports with Pivots, charts etc…
Please find below sample output for reference.
Pool Capacity Report:
Disk Capacity Report:
P.S: I’ve removed VMAX serial number for various factors 🙂
If interested, please reach out to me to get these PERL scripts.