Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Amazon AWS Cloudwatch report memory metric bash script
#!/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
You can’t perform that action at this time.