Below you will find pages that utilize the taxonomy term “Cloud”
PostsInstall the Ansible role
read more
Installing AWS CloudWatchAgent On EC2 Instance Via Ansible
Install the Ansible role gavika.aws_cloudwatchagent
via Galaxy
ansible-galaxy install gavika.aws_cloudwatchagent
Create The Playbook File - cw-play.yml :
---
- hosts: all
become: true
vars:
roles:
- role: gavika.aws_cloudwatchagent
Prepare the AWS CloudWatch Agent configuration
In your variables file, use aws_cloudwatch_agent_config
agent:
metrics_collection_interval: 60
run_as_user: "cwagent"
metrics:
namespace: "Gavika"
append_dimensions:
InstanceId: "${aws:InstanceId}"
metrics_collected:
disk:
measurement:
- used_percent
metrics_collection_interval: 60
resources:
- "*"
mem:
measurement:
- mem_used_percent
metrics_collection_interval: 60
In this example, I am using the namespace, Gavika
. Feel free to change it. We collect the cpu
, disk
, diskio
,
mem
and swap
metrics. The agent will send these metrics once in 360
seconds.