-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCloudwatch-Memory-Metric
51 lines (24 loc) · 1.1 KB
/
Cloudwatch-Memory-Metric
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
************************************************************
Cloudwatch RAM Mointoring
************************************************************
----*** Create IAM role ***----
* Go to IAM
* Create Role
* Under permission - tick - CloudwatchFullAccess
* Attach role to the EC2 instance
----*** Configure Monitoring Script ***----
$ sudo apt-get update
$ sudo apt-get install unzip
$ sudo apt-get install libwww-perl libdatetime-perl
$ curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O
$ unzip CloudWatchMonitoringScripts-1.2.2.zip && \
rm CloudWatchMonitoringScripts-1.2.2.zip && \
cd aws-scripts-mon
## Test the script
$ ./mon-put-instance-data.pl --mem-util --verify --verbose
## Send metric to cloudwatch
$ ./mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --mem-used --mem-avail
## Scheduling the process of sending metrics
$ crontab -e
*/5 * * * * ~/aws-scripts-mon/mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --disk-space-util --disk-path=/ --from-cron
## Go on CloudWatch and check for metrics