Skip to main content

aws-cloudwatch

Query AWS CloudWatch metrics, alarms, and log groups.

소스 정보

저장소
ThinkfleetAI/thinkfleet-engine
최근 소스 활동
2026년 2월 1일 16:21
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
aws-cloudwatch
description
Query AWS CloudWatch metrics, alarms, and log groups.
metadata
{"thinkfleetbot":{"emoji":"📊","requires":{"bins":"[Truncated]","env":"[Truncated]"}}}
# AWS CloudWatch Query metrics, alarms, and logs. ## List alarms ```bash aws cloudwatch describe-alarms --state-value ALARM --query 'MetricAlarms[].{Name:AlarmName,State:StateValue,Metric:MetricName,Reason:StateReason}' --output table ``` ## List all alarms ```bash aws cloudwatch describe-alarms --query 'MetricAlarms[].{Name:AlarmName,State:StateValue,Metric:MetricName,Namespace:Namespace}' --output table ``` ## Get metric data ```bash aws cloudwatch get-metric-statistics \ --namespace AWS/EC2 --metric-name CPUUtilization \ --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \ --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%S) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \ --period 300 --statistics Average --output table ``` ## List log groups ```bash aws logs describe-log-groups --query 'logGroups[].{Name:logGroupName,Stored:storedBytes,Retention:retentionInDays}' --output table | head -30 ``` ## Tail logs ```bash aws logs tail /aws/lambda/my-function --since 1h --format short ``` ## Search logs (filter pattern) ```bash aws logs filter-log-events --log-group-name /aws/lambda/my-function \ --filter-pattern "ERROR" --start-time $(date -d '1 hour ago' +%s000) \ --query 'events[].{Time:timestamp,Message:message}' --output table | head -30 ``` ## List dashboards ```bash aws cloudwatch list-dashboards --query 'DashboardEntries[].{Name:DashboardName,Size:Size,Modified:LastModified}' --output table ``` ## Put metric alarm ```bash aws cloudwatch put-metric-alarm \ --alarm-name "HighCPU" --metric-name CPUUtilization \ --namespace AWS/EC2 --statistic Average --period 300 \ --threshold 80 --comparison-operator GreaterThanThreshold \ --evaluation-periods 2 \ --dimensions Name=InstanceId,Value=i-1234567890abcdef0 echo "Alarm created" ``` ## Notes - Use `aws logs tail --follow` for real-time log streaming. - `date -d` syntax is Linux; macOS uses `date -v-1H` instead. - Confirm before creating or modifying alarms.
GitHub에서 보기