Last active
September 7, 2017 21:16
-
-
Save lsauer/28c34370f89077ede252dc18494f0cd1 to your computer and use it in GitHub Desktop.
Amazon AWS Cloudwatch report memory metric bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
memory=$(cat /proc/meminfo | grep MemFree: | awk '{print $2}') | |
memory=$(echo $memory/1000 | bc) | |
echo memory is: $memory | |
aws cloudwatch put-metric-data --metric-name Memory\ | |
--namespace WebServer\ | |
--unit Bytes \ | |
--value $memory\ | |
--dimensions InstanceID=i-093beb71f2d7647ce,InstanceType=m1.small\ | |
--region eu-west-1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment