Slack: Python script to count member’s messages

“Launched in 2014, Slack is the fastest growing business application in history. Millions of people around the world use Slack to bring their teams together, make sense of their work, and drive their business forward.”

I love using this ‘productivity tool’ and we do use @here quite often ūüėõ

Recently, one of my colleagues came to me with an idea to develop a script to count # of messages in a given list of slack channels on a given day.

Continue reading “Slack: Python script to count member’s messages”

Advertisements

VMAX3 Snapshot Aging Report

Data Storage cleanup/reclaim is similar to how we manage “kinds of stuff” in our homes. We think what to keep and not to after taking the holistic decision. Time & Value will decide what is to be discarded in near future…

An All-Flash Storage array (AFA’s) gives the best performance and greater value to the business. But every GB of All-Flash Storage is at least 3 times costlier than that of mechanical drives. It is critical to perform frequent clean up of these kinds of arrays to make sure that only the mission/business critical data and deserving information should reside on All-Flash array.

From the business perspective, the concerned team needs to do the regular drills to identify then inform IT Ops to discard stale or amassed data ASAP. This requires the team to do a logical distinction of information based on value or tasks, seek approvals from respective Business Unit Owners before proceeding to do clean up.

Continue reading “VMAX3 Snapshot Aging Report”

Setup Active Directory Authentication for Rundeck

Rundeck is a simple & easy product to setup workflow and automation tool. By default, it comes with the default local user accounts. Rundeck supports LDAP, AD, PAM and Pre-Auth methods. But the downside is Rundeck’s¬†documentation¬†which is not that great to configure LDAP/AD based authentication.

After multiple attempts and spending a whole day searching on the internet; able to configure AD authentication… Here are the simple steps for Rundeck AD auth configuration.

Continue reading “Setup Active Directory Authentication for Rundeck”

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

Continue reading “VMAX SRP Utilization Report & Upload to MySQL DB using Python”

Add a remote node in Rundeck

To add a remote node in Rundeck, we need to have SSH connectivity (usually port # 22) and to setup a SSH based key based authentication between Rundeck server & client. Please click here and follow the guide to setup key based authentication as a first step.

After setting up key based auth, test the SSH connectivity. Copy the file id_rsa from your home directory to the below path

# cp/home/<USERNAME>/.ssh/id_rsa  /var/lib/rundeck/.ssh/id_rsa

Third step is to add node details in the resources.xml file

Path Р/var/rundeck/projects/VEC-Storage/etc/resources.xml and add entries as shown below. By default, Rundeck server information which is a first node definition would be there already. (open with your favorite {nano} editor)

<?xml version=”1.0″ encoding=”UTF-8″?>

<project>
<node name=”SAS” description=”Rundeck server node” tags=”RDS” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” osVersion=”4.9.0-2-amd64″ username=”rundeck”/>
<node name=”Name” description=”Windows Jump2″ tags=”JMP” hostname=”<name/IP>” osFamily=”windows” username=”user” ssh-keypath=”/var/lib/rundeck/.ssh/id_rsa”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”Windows Jump1″ tags=”JMP1″ hostname=”<name/IP>” osFamily=”windows” username=”user” ssh-keypath=”/var/lib/rundeck/.ssh/id_rsa”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>
</project>

There are multiple nodes definitions of both OS types (both *nix & Windows) added to Rundeck. Tags come in handy while defining the node attributes which helps in grouping similar type of clients. As an example shown above, tags=’SYM’ represent that the client is a EMC VMAX Mgmt. Host running with SYMCLI & Unisphere for VMAX services.

To run a command across all nodes, simply type in the tag name and run the command from Rundeck >Menu Bar > Commands. PFB Screenshots for reference.

2017-12-12 21_29_03-Commands - VEC-Storage

Output of above command from all the nodes are as under.

2017-12-12 21_53_06-192.168.60.63_4440_project_VEC-Storage_execution_downloadOutput_11924_view=inlin

Troubleshooting: In case of SSH connectivity issue, edit the sudoers file (visudo) and remove the comment of below line. But before making changes, consult your administrator whether this incline with standard policies.

Defaults !requiretty

SSH Keys – Password less authentication

I was trying to setup SSH Keys between two different flavors of Linux Host by following this Howto

I did run commands exactly as per mentioned in the how to; but it didn’t work. Error message as under

vin@CLIENT:~$ ssh vsa@192.0.0.10
vin@192.0.0.10’s password:
Last login: Mon May 22 10:45:03 2017 from 192.0.0.10
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: tty: command not found
-bash: uname: command not found

After googling and trail and error method finally found a fix.

Instead of Step 3 as per the above How to, use the below commands.

  1. Ensure on the server proper permissions set on the .ssh folder if not set permissions as

$chmod -R 775 .ssh (.ssh is located in user home directory e.g: /home/vin)

  1. Run this command to copy the Key file from client to server

$cat ~/.ssh/id_rsa.pub | ssh vin@192.0.0.10 ‘umask 0077; /bin/mkdir -p .ssh; /bin/cat >> .ssh/authorized_keys && echo “Done!”‘

After running above command, server 192.0.0.10 do not ask for password when user vin try to login.

vin@CLIENT:~$ ssh vin@192.0.0.10
Last login: Mon May 22 11:54:29 2017 from 192.0.0.10
[vin@SERVER ~]$

Multi Apps installer for Windows

I joined the company¬†Virtustream yesterday and got a brand new Dell Latitude E5470 laptop. It has all basic software’s preinstalled through image but still missing many tools which I use in my day to day work.

A simple way to install most of the productive tools at one go is ninite.com. Just select what you want to install from the list of software’s and download a small file and execute it. That’s it! all your software’s will be installed automatically and ready to use. There wont be any pop-ups or prompts asking for confirmation etc…

ninite

Happy New Year 2017!