Authorkilawang

自定義加入監控指標至CloudWatch

需先安裝AWS Cli

 

#查詢本機id

 

#call api 給cloudwatch
#aws cloudwatch put-metric-data –namespace HttpServerMetrics –metric-name  –dimension InstanceId=$instance_id –value $mem –unit “Megabytes”

 

#監控shellscript
#!/bin/bash
disk=`df -lha|grep /dev|head -1|awk ‘{printf $5}’`
aws cloudwatch put-metric-data –namespace disksize–metric-name disksizeuse –dimension InstanceId=$id –value $disk –unit “Percent”

AWS的基本架構圖

123

 

© 2024 Kila's IT Home

Theme by Anders NorénUp ↑