deekayen.cloudwatch_monitoring_scripts
AWS CloudWatch Monitoring Scripts
This is an Ansible role that installs the AWS CloudWatch Logs agent and monitoring scripts on Enterprise Linux.
For more information, visit: AWS CloudWatch Quick Start for EC2
The role also installs a monitoring script for Linux to check memory, CPU, swap, and more. You must attach a role to your instance (or use credentials) to write to CloudWatch.
See more here: Monitoring Scripts for EC2
Requirements
You must attach a role to your EC2 instance to send messages to AWS CloudWatch.
Refer to: AWS CloudWatch Quick Start for EC2
Role Variables
aws_mon_script_install_dir: "/opt"
aws_mon_script_url: "https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip"
Dependencies
This implementation is written in Perl, so some CPAN libraries are needed.
- role: blackstar257.perl
vars:
perl_cpanm_modules:
- Switch
- DateTime
Note that the AWS CloudWatch Agent needs to be installed first. While this isn't a required role dependency, you may want to run this role in your playbook before the one mentioned above:
- src: git+https://github.com/riponbanik/ansible-role-aws-cloudwatch-agent.git
name: riponbanik.aws-cloudwatch-agent
version: 80203e57822b3c1424460a9d222f47f668e114e7
Example Playbook
Here’s how to use this role, showing an example playbook including variables:
- hosts: all
roles:
- deekayen.cloudwatch_monitoring_scripts
License
MIT
Install AWS CloudWatch Agent scripts to send metrics for monitoring memory, swap, and disk space.
ansible-galaxy install deekayen.cloudwatch_monitoring_scripts