Skip to content

Commit

Permalink
Update mem.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwee-Veen authored Apr 18, 2024
1 parent 4bd0a4b commit a097716
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ INSTANCE_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.2

USEDMEMORY=$(free -m | awk 'NR==2{printf "%.2f\t", $3*100/$2 }')
TCP_CONN=$(netstat -an | wc -l)
TCP_CONN_PORT_80=$(netstat -an | grep 80 | wc -l)
TCP_CONN_PORT_3000=$(netstat -an | grep 3000 | wc -l)
IO_WAIT=$(iostat | awk 'NR==4 {print $5}')

aws cloudwatch put-metric-data --metric-name memory-usage --dimensions Instance=$INSTANCE_ID --namespace "Custom" --value $USEDMEMORY
Expand Down

0 comments on commit a097716

Please sign in to comment.