Amazon Cloudwatch

Resources

General Explanation

What you can monitor:

  • Amazon Elastic Load Balancers for metrics such as request count and latency;
  • Amazon EBS volumes for metrics such as read/write latency;
  • Amazon RDS DB instances for metrics such as freeable memory and available storage space;
  • Amazon SQS queues for metrics such as number of messages sent and received;
  • Amazon SNS topics for metrics such as number of messages published and delivered
  • Can also monitor metrics that are generated by the applications you run on AWS resources. Using a simple Put API call look at the developer guide

Getting Started

Image that explain very good what is cloud watch

CW-Overview.png

continue from "Amazon CloudWatch Concepts"

Install a monitor inside the machine

Guide:

syntaxt command for linux ubuntu

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html

sudo apt-get install unzip libwww-perl libcrypt-ssleay-perl libswitch-perl
wget http://ec2-downloads.s3.amazonaws.com/cloudwatch-samples/CloudWatchMonitoringScripts-v1.1.0.zip
unzip CloudWatchMonitoringScripts-v1.1.0.zip
rm CloudWatchMonitoringScripts-v1.1.0.zip
cd aws-scripts-mon

if you have not assigned a role to the machine at creation time you need to configure the awscred.conf file

cp awscreds.template  awscreds.conf
nano awscreds.conf
###put the credential
export AWS_CREDENTIAL_FILE=/root/aws-scripts-mon/awscreds.conf

or you can specify at the command line the credential
or specify at the command line the config file —aws-credential-file=/root/aws-scripts-mon/awscreds.conf
test if works
./mon-put-instance-data.pl --mem-util --verify --verbose --aws-credential-file=/root/aws-scripts-mon/awscreds.conf

a cron line with almost everything

* *     * * *     root    /root/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail --aws-credential-file=/root/aws-scripts-mon/awscreds.conf --from-cron --disk-path=/ --disk-space-avail --disk-space-used --disk-space-util --swap-util --swap-used
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License