GithubHelp home page GithubHelp logo

ecstats2's Introduction

ECSTATS

ECstats is a tool for extracting ElasticCache database metrics. The script is able to process all the Redis databases, both single instance, replicated and clustered ones that belong to specific AWS region. Multiple regions can be defined in the configuration.

The script will purely query cloudwatch for the metrics. It will never connect to the Redis databases and it will NOT send any commands to the databases.

This script by no means will affect the performance and the data stored in the Redis databases it is scanning.

The script will need at minimum CloudwatchReadOnlyAccess & AmazonElastiCacheReadOnlyAccess privilleges for extracting the information.

Installation

There are couple of ways to run the script which are mentioned as below:

1. Running the script from source

Pre-requisites: The script will run on any system with Python 3.6 or greater installed.

Download the repository

# git clone https://github.com/Redislabs-Solution-Architects/ecstats2 && cd ecstats2

Prepare and activate the virtual environment

# python3 -m venv .env && source .env/bin/activate

Install necessary libraries and dependencies

# pip install -r requirements.txt

Copy the example configuration file and update its contents to match your configuration. AWS User Access Key ID and Secret Access Key are needed to access your AWS ElastiCache instances. Multiple AWS Environments (e.g Production, Staging) and AWS Regions can be defined in this file and the script will process all the AWS ElastiCache instances that are defined as separate sections in the config.ini file.

# cp config.ini.example config.ini && vim config.ini

Execute below python command to run the script. Use -c option with configuration file if the file name is different from config.ini

# python ecstats.py -c config.ini

When finished do not forget to deactivate the virtual environment

# deactivate

2. Running the script from Docker image

Pre-requisites: You have Docker engine installed on your machine. Refer this link to install Docker engine: https://docs.docker.com/engine/install/

Download the repository

# git clone https://github.com/Redislabs-Solution-Architects/ecstats2 && cd ecstats2

Copy the example configuration file and update its contents to match your configuration. AWS User Access Key ID and Secret Access Key are needed to access your AWS ElastiCache instances. Multiple AWS Environments (e.g Production, Staging) and AWS Regions can be defined in this file and the script will process all the AWS ElastiCache instances that are defined as separate sections in the config.ini file.

# cp config.ini.example config.ini && vim config.ini

Execute the script using docker run command. Use -c option with configuration file if the file name is different from config.ini

# pwd

For example, output of this command is /a/path/to/ecstats. Use the below docker command to run the script

# docker run -v /a/path/to/ecstats:/app -t sumitshatwara/redis-ecstats python3 ecstats.py

ecstats2's People

Contributors

erniavr avatar kesseract avatar rahulchauhan20 avatar thomasefthymiou78 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.