]]>Today, we will learn how to create custom CloudWatch metrics like RAM Usage and Disk Usage in centos 7?

What made me do this and why it is important?

Let’s see monitoring is a very important part of maintaining our servers. Also, AWS didn’t support these monitoring scripts for Centos. This made it difficult for a system administrator to monitor the environment.

Monitor RAM and Disk Usage in CentOS 7

A little bit about a script:

Script Name: mon-put-instance-data.pl

Purpose: This script is written in pearl and is used to collect metrics of swap, disk, and memory. In this blog, we will create custom CloudWatch metrics for RAM and disk.

Well, you are at the right place, because I’m going to show you how it’s done.

Prerequisite:

Centos 7

AWS IAM role with EC2 and CloudWatch access. You need to attach the role to your centos instance.

Enter these cronjob commands to send RAM and Disk Usage to AWS CloudWatch:Note: Instead of “/home/centos” enter your directory where you have installed the script. In the disk-path enter the mounted path of the volume whose metrics you want. In this case, I want metrics of the root EBS volume.