AWS Memory Stats - Linux

Document created by fadi.josef Expert on Mar 27, 2017Last modified by fadi.josef Expert on May 13, 2017
Version 19Show Document
  • View in full screen mode

In this document, we will look at how we can publish AWS used Memory stats to CloudWatch so that Turbonomic can pull the memory metrics.

 

Step 1: Login to your AWS Linux instance 

Step 2: Download the script from AWS Website

curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O

Step 3: Install the required prerequisites 

You must run as root to be able to install these packages.

Amazon Linux AMI

  • sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https

Red Hat Enterprise Linux

  • sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA -y
  • sudo yum install zip unzip

SUSE Linux Enterprise Server

  • sudo zypper install perl-Switch perl-DateTime
  • sudo zypper install –y "perl(LWP::Protocol::https)"

Ubuntu 

  • sudo apt-get update
  • sudo apt-get install unzip curl
  • sudo apt-get install libwww-perl libdatetime-per

Debian

  • apt-get update
  • apt-get install unzip curl
  • apt-get install libwww-perl libdatetime-perl liburi-perl

Step 4: Unzip the downloaded file, and then go to the extracted directory.

unzip CloudWatchMonitoringScripts-1.2.1.zip

cd aws-scripts-mon

Step 5:  Copy the awscreds.template to awscreds.conf 

cp awscreds.template awscreds.conf

Step 6: vi the awscreds.conf file and add your AWS Access Key and AWS Secret Key

AWSAccessKeyId=my-access-key-id

AWSSecretKey=my-secret-access-key

Step 7: Setup a Crontab so that the script runs in the background every 5 minutes.

crontab -e

*/5 * * * * /tmp/aws-scripts-mon/mon-put-instance-data.pl --mem-used

Now you will start seeing the used memory metrics being published to AWS CloudWatch every 5 minutes and then Turbonomic will be able to pull in the stats. 

Attachments

    Outcomes