AWS cloudwatch alarm for RDS - amazon-web-services

Is there a way to make an alarm on cloudwatch for my RDS instances based on % free disk (i know i can turn on enhanced monitoring and that metric is there, but i can't use those metrics on cloudwatch alarms)
if not is there a good way out ?

RDS doesn't report percentage of disk space free, but it does report the amount of free space available. See the list of CloudWatch metrics available for your RDS instances here.
You would need to create alarms on the FreeStorageSpace metric reported by each of your instances.

See an option using Enhanced Monitoring and log metrics enter link description. Basically you can turn on enhanced monitoring for RDS and then parse the JSON logs to get the usedPercentage value for the storage filesystem. This can be turned into a log metric that can be associated with an alarm.

Related

EC2 Detailed Monitoring vs CloudWatch Agent

What's the whole purpose of EC2 Detailed Monitoring? Is it just about sending metrics with more frequency to CloudWatch?
I was wondering if it's capable of monitoring Memory and Swap like the CloudWatch Agent is, or if its purpose is simply to "send data faster" to CloudWatch.
Thanks!
Is it just about sending metrics with more frequency to CloudWatch
Almost. You get faster metrics, and also ability to aggregate them across similar instances.
I was wondering if it's capable of monitoring Memory and Swap like the CloudWatch Agent is,
No. You need Agent for that.

How to create usage alarm using Cloudwatch for Service Quota when the Utilization is Not available in AWS

I want to create alerts in aws to notify when the service quota utilization has crossed the threshold value for service quotas for which the Utilization field is disabled
I am trying to create Infrastructure quota monitoring alerts in aws , but for few service quotas I am unable to create it .
For example, Internet gateways per Region from Amazon VPC has utilization field disabled, no create alarm option available under it along with usage graph , and there is no metrics for that under CloudWatch All metrics then All->Usage->By AWS Resource , which is needed to create usage alarms .(https://i.stack.imgur.com/5yjsZ.png)
What is the reason that some of the service quotas doesn't have the utilization details available? and how to create usage quota alarm for those?
I haven't tried this but as I can see In docs that service quotas is integrated with cloudtrail, so you can create a cloudwatch alarm on cloudtrail for that particular event quota logs.
Create a filter based on the logs you see on cloudtrail and for cloudwatch alarms threshold value should be service quota threshold value.When your metric filter crosses the threshold value, you will recieve an alert.
Ofcourse you would need to find the cloudtrail logs for that service quota in order to create filter pattern.
See creating alarms for cloud trails

How to disable AWS Cloudwatch metrics

I'm new and am trying to work with AWS. I develop small lambda functions and have created some dynamodb tables. I don't expect there to be any costs, because I should be in the free-tier, but since last month I am seeing costs for "Cloud Watch Alarms". Not high costs, but I got billed $0.53. Why I am getting this bill even though I am using AWS free tier.
Billing info:
$0.00 per alarm-month - first 10 alarms 10 Alarms $0.00
$0.10 per alarm-month 4.277 Alarms 0.43$
I don't want these cloudwatch metrics right now. I only want to store log files. How can I to disable these cloudwatch metrics.
Thanks,
You have configured, maybe unintentionally, a Cloud Watch Alarm.
Fortunately it's quite easy to remove it.
Go to your AWS Dashboard and select Cloud Watch:
On the left-hand side, click on Alarms. Select the Alarm which you want to remove and delete it.
This is what I got from AWS Support:
CloudWatch collects and processes raw data from DynamoDB into readable, near real-time metrics. These statistics are recorded for a period of two weeks, so that you can access historical information for a better perspective on how your web application or service is performing. By default, DynamoDB metric data is sent to CloudWatch automatically.
When you interact with DynamoDB, it sends the following metrics and dimensions to CloudWatch. Note that Amazon CloudWatch aggregates the following DynamoDB metrics at one-minute intervals:
> ConditionalCheckFailedRequests
> ConsumedReadCapacityUnits
> ConsumedWriteCapacityUnits
> ReadThrottleEvents
> ReturnedBytes
> ReturnedItemCount
> ReturnedRecordsCount
> SuccessfulRequestLatency
> SystemErrors
> TimeToLiveDeletedItemCount
> ThrottledRequests
> TransactionConflict
> UserErrors
> WriteThrottleEvents
I'm trying to find out if there is a way to turn this off and will update my answer when I get it
Well you can do that via SCP's to sit a generic policy to deny such api

How to get information on which resource actually breached cloudwatch alarm

I have setup a cloudwatch alarm for RDS "By Database Engine" for postgres for "FreeableMemory" metric and assign an alarm when the Free Memory is less than 1GB. When an alarm is raised, is it possible to get the information on which specific RDS resource/instance actually breached the alarm?.
I could specify "Per Database" metric but then I have to setup one for every instance of db I got. Is it possible to set alart for broader category like "By Database Engine" and when alarm is breached, just look at the event payload and get list of resources that actually breached the alarm?
I don't think you could include that information in your Database Engine level alarm. However, once the alarm is raised, you can easily see which DB has that metric crossed your threshold. Just go to CloudWatch metrics and select FreeableMemory metric and then select all databases from the list. In the diagram you can see any instances above the threshold.
As you mentioned, you could also create an alarm for each DB instance. That may be a tedious task if you do it manually, but you can easily automate it using a script which iterates through the list of your DB instances.

How to use CloudWatch to check if you AWS RDS instance's is down

I want to know when my RDS Instance is down (in a "failed" or other state). Going through this article: Monitoring Amazon RDS and looking at the Cloudwatch Metrics when trying to create an alarm, it doesn't seem possible to use CloudWatch to check the status directly (if its "available" or not).
Is my only option to use the other metrics to indirectly if its down (eg. CPU usage at 0%)? If so which metrics should I use?
You don't use CloudWatch for this. RDS will notify you of this sort of issue directly. You just need to setup event notification in RDS.
See documentation: Using Amazon RDS Event Notification