terraform.aws-baseline-infra/modules/ManagementGovernance/Monitoring.EC2/get-cwagent-dimensions.sh

7 lines
259 B
Bash
Executable File

#!/bin/bash
eval "$(jq -r '@sh "id=\(.input)"')"
aws cloudwatch list-metrics --namespace CWAgent --metric-name disk_inodes_free \
--dimensions Name=InstanceId,Value=$id Name=path,Value=/ | \
jq '.Metrics[] | .Dimensions[] | {(.Name):(.Value)}' | jq -s 'add'