Amazon Cloudwatch
Resources
- general explanation http://aws.amazon.com/cloudwatch/
- GettingStarted http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/.html
- API guide http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html
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
continue from "Amazon CloudWatch Concepts"
Install a monitor inside the machine
Guide:
- windows http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts-powershell.html
- linux http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts-perl.html
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
versione della pagina: 4, ultima modifica: 15 Jun 2016 16:03