AWS Linux Server Health Monitoring Using CloudWatch
Login In AWS Linux Instance with ec2-user or sudo user
Install Pre-requesting packages
1:- sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog
perl-LWP-Protocol-https perl-Digest-SHA zip unzip
2:- sudo mkdir cloudwatch; cd cloudwatch; ll
Download and Install Monitoring script
4:- sudo curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip
-O; sudo unzip CloudWatchMonitoringScripts-1.2.1.zip;ll
Entry in Crontab for Every 5 minute
5:- crontab -e
*/5 * * * *
~/cloudwatch/aws-scripts-mon/mon-put-instance-data.pl --mem-util
--disk-space-util --disk-path=/ --from-cron
*/5 * * * *
~/cloudwatch/aws-scripts-mon/mon-put-instance-data.pl --disk-space-util
--disk-path=/data2 --from-cron
Now GoTo In EC2 and Select ec2-Instance and check IAM Role is already created or Not
(If IAM Role is already present like below screenshot then click on role ex:- click on 1-HC-Ambari)
Now Attached Policy {AllowCloudWatch} in IAM Role (1-HC-Ambari)