Exaforge

Cloud, DevOps, Evangelism

vCenter Ops (vCops) Data Extraction Tool 1.0

This morning I'm pleased to release the vCops Data Extraction Tool 1.0

Have you ever wanted to extract raw data from your vCops installation.  By raw I mean really raw - each and every timestamped value for each metric and resource?  I had such a need recently for an upcoming secret project, so I decided to write such a tool  Because I wanted this to be cross platform, my previous work with Clint Kitson based on Powershell was out.  So, my backup language is always Python, and I chose that.

I'm posting the code here under a Creative Commons license for everyone to use as needed.  As an example of how to run it (it does include help if you need it):

python vcopsextract.py --oraclehome /u01/app/oracle/product/11.2.0/xe/ --sqlplus /u01/app/oracle/product/11.2.0/xe/bin/ --user vcops11 --password usr4vcops --oracleSID XE --oraclehost localhost --outputfile data.out --debugfile debug.out --vcopsurl http://localhost/HttpPostAdapter/OpenAPIServlet --days 1

Most of this just specifies the Oracle database (which I need to connect to and query for the resource metric names, etc), the output files, the OpenHTTPAdapter location and the number of days of data to retrieve.  I highly recommend restricting the number of days of data to retrieve to a reasonable number like 7, as the data generated by this tool is quite significant.  As an example, in my small vCenter + VNX demo environment with about 566 resources, 7 days of data was well over 8GB of text files.

When it executes it looks something like this:

vCops Extractor Run

 

 

 

Note the pretty progress bars :)

When its complete, you'll see in the datafile:

The first like is a token indicating when this file was created (milliseconds since Epoch).  The second line is the vCops-style information about the resource, including its name, Adapter Type, Identifiers, etc.

The following lines are the metrics for each individual metric with:

metricname,alarmlevel,<blank>,timestamp,value,<blank>

This format is intended to be easily reimported to vCops later.

TODOs:

  • Enable gzip'd output
  • Enable selection only of certain resources
  • Enable selection only of certain metrics
  • Other?

Download Here