1 Answer
- Newest
- Most votes
- Most comments
0
After holding off and doing other things, I have figured it out. So what I did was a simple bash script to get the load and push that as a custom metric that runs every minute.
Here is the basic script if anyone wants/needs but having the load vs the CPU is a much better representation to the box as there are so many factors that can slow a server down;
#!/usr/bin/env bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
#Grab the load (and only the first 1 minute average)
load=$( cat /proc/loadavg | awk '{print $1;}' )
#to get the instance-ID
id=`cat /var/lib/cloud/data/instance-id`
#echo $id
#echo $load
aws cloudwatch put-metric-data --metric-name="load" --namespace "ServerLoad" --dimensions Instance=$id --value $load
Thanks
answered 2 years ago
Relevant content
- asked 3 years ago
- asked 2 months ago
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago