0% found this document useful (0 votes)
48 views3 pages

Create Cloudwatch Cluster Ang Get Data

This document discusses how to set up CloudWatch monitoring on an EC2 instance to view memory usage, available memory, and CPU utilization on a single dashboard. It provides steps to install Perl packages, download CloudWatch monitoring scripts, configure credentials, test the scripts, and set up a cron job to automatically transfer data from the instance to CloudWatch.

Uploaded by

Govind Hivrale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views3 pages

Create Cloudwatch Cluster Ang Get Data

This document discusses how to set up CloudWatch monitoring on an EC2 instance to view memory usage, available memory, and CPU utilization on a single dashboard. It provides steps to install Perl packages, download CloudWatch monitoring scripts, configure credentials, test the scripts, and set up a cron job to automatically transfer data from the instance to CloudWatch.

Uploaded by

Govind Hivrale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

How to setup cloudwatch and how to see memroy usage ,memroy availble

and cpu utilazation on one dashboard


Introduction : cloudwatch is a one of the most papular service of aws cloud , cloudwatch is a
monitaring tool ,they check the your ec2 instances health as well as continuous monitaring

In This article we are going to discuss about the cloud watch and how to set monitaring using perl
script you can check cpu utlization default but you cann’t check memroy usages and other services
let’s start

Step -1
For Monitaring scripts used in perl script for this purpose you need to install perl package on your
ec2 instance using following command you can install perl package , Firstly update package and
install

For Ubuntu run:


apt update
apt-get install libwww-perl libdatetime-perl

For RHEL based systems run:


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

For SUSE Linux Enterprise run:


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

If you didn’t have the unzip package you need to install unzip package

For ubuntu:
apt-get update
apt-get install unzip

For RHEL
sudo yum install zip unzip

For SUSE

sudo zypper install unzip

Setting up a IAM user on AWS:


How to setup cloudwatch and how to see memroy usage ,memroy availble
and cpu utilazation on one dashboard

Installing the monitoring scripts on the instance


Run the below command and download the zip folder for the monitaring scripts from
amazon
curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-
1.2.1.zip -O

unzip the folder using following command


unzip CloudWatchMonitoringScripts-1.2.1.zip

rm CloudWatchMonitoringScripts-1.2.1.zip

Now go to main directory


cd aws-scripts-mon
mv awscreds.template awscreds.conf
Now using nano editer add Credentials of your IAM user and set permission
But Firstly you need to configure your IAM role and give access permision
and add the this in your ec2 instance
nano awscreds.conf

add
AWSAccessKeyId=AKIA2544XUKRHWRL54IT
AWSSecretKey=3x4mp13/5Pdc2z83wOK1XDMPI/sGGlo+NyBM4fI

save this file using Ctrl + o and enter then Ctrl + x to save and exit

Testing:
Run the command for testing
./mon-put-instance-data.pl --mem-util --mem-used --disk-path=/ --disk-space-
util --disk-space-avail --verify --verbose
How to setup cloudwatch and how to see memroy usage ,memroy availble
and cpu utilazation on one dashboard

CRON setup
Add all script in the cron and automate transfer data to the cloudwatch
crontab -e

now,add the script and set minute means check automatically data transfer to the cloud
and add the scripts and save using Ctrl + o then Enter and exit using Ctrl + z

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


--disk-path=/ --disk-space-util --disk-space-avail –from-cron

Now go to amazon console and check

You might also like