Amazon RDS is a popular service that allows organizations to efficiently operate and scale a relational database in the AWS Cloud. If you are using RDS DB instances, monitoring their performance could be business-critical.
Enhanced Monitoring is a feature that enables organizations to collect more frequent, real-time metrics about the operating system that your DB instances run on.
These metrics are displayed in your Amazon CloudWatch Logs account and available to be used to identify potential failures, overloads, and anomalies. Enhanced monitoring adds more layers of reliability, availability, and performance to your existing AWS monitoring features and capabilities.
Finding RDS instances Without Enhanced Monitoring
You can tell that an instance does not have Enhanced Monitoring turned on if its monitoring interval is set to 0. The monitoring interval indicates how many seconds go by between collecting Enhanced Monitoring metrics.
The output of this command lists the identifier and status for each applicable instance.
Now that you know which instances do not currently have enhanced monitoring turned on, you can modify them to turn it on.
Turning On Enhanced Monitoring for RDS instances
To enable Enhanced Monitoring for RDS instances with the AWS CLI, you need an IAM role that has the necessary permissions. If you don’t already have a role for this, you can create one in the IAM console. Here’s how:
Create an IAM role
- Open the IAM console.
- Find Roles in the navigation pane.
- Click Create roles.
- Choose AWS service and RDS.
- Select RDS - Enhanced Monitoring and click Next.
- Double check that Permissions Policies is set to AmazonRDSEnhancedMonitoringRole and click Next.
- Enter a name for your role under Role Name.
- Click Create Role.
This IAM role grants Enhanced Monitoring permissions to act on your behalf to send automated OS metric information to CloudWatch Logs.
Turning on Enhanced Monitoring Using the CLI
To turn on Enhanced Monitoring, there are two modifications you need to make:
- Set the monitoring interval for your chosen RDS instances at one value of 1, 5, 10, 15, 30, or 60 but not 0.
- Set the --monitoring-role-arn option to your created AMI role
Turn on Enhanced Monitoring for a DB instance:
For Linux, macOS, or Unix:
If you are using a Multi-AZ DB cluster instead, enabling Enhanced Monitoring requires a different command.
Turn on Enhanced Monitoring for a Multi-AZ DB cluster:
For Linux, macOS, or Unix:
Once you have turned on Enhanced Monitoring, you’ll have real-time visibility into the performance of your RDS instances.
Automating Enhanced Monitoring Checks with Blink
You can run this check every now and again, but by the time you realize you don’t have enhanced monitoring enabled on a new instance, you will have missed out on collecting metrics for a period of time.
With Blink, you can schedule a no-code automation to run regularly to detect RDS instances without Enhanced Monitoring enabled. Running checks like this is easy to do with Blink.
Create your free Blink account and get started automating common AWS checks today.