12

So I've been using Boto in Python to try and configure autoscaling based on CPUUtilization, more or less exactly as specified in this example: http://boto.readthedocs.org/en/latest/autoscale_tut.html

However both alarms in CloudWatch just report:

State Details: State changed to 'INSUFFICIENT_DATA' at 2012/11/12 16:30 UTC. Reason: Unchecked: Initial alarm creation

Auto scaling is working fine but the alarms aren't picking up any CPUUtilization data at all. Any ideas for things I can try?

Edit: The instance itself reports CPU utilisation data, just not when I try and create an alarm in CloudWatch, programatically in python or in the interface. Detailed monitoring is also enabled just in case...

Thanks!

1
  • Unfortunately the only way I could my alarm to work was by building it in the AWS console, using the CLI to get all the attributes and then copying those attributes into CloudFormation - I don't think the documentation alone is enough to dive straight into CloudFormation or similar.
    – tschumann
    Nov 19, 2019 at 4:55

10 Answers 10

11

The official answer from AWS goes like this:

Hi, There is an inherent delay in transitioning into INSUFFICIENT_DATA state (only) as alarms wait for a period of time to compensate for metric generation latency. For an alarm with a 60 second period, the delay before transition into I_D state will be between 5 and 10 minutes.

John.

Apparently this is a temporary state and will likely resolve itself.

2
  • 3
    Its been like this all day- have had AWS support chat for a few hours and they haven't got anywhere...
    – Marogian
    Nov 12, 2012 at 18:48
  • Ugh! Well, you know how it goes with that darn metric generation latency... Wish I could be more help.
    – platforms
    Nov 12, 2012 at 19:08
5

I am not sure what's going on in the backend, but if you compare the alarm history you will see AWS remove the 'unit' column if you just modify the alarm without any change as at7000ft said. So remove the unit column of your script.

1
  • This is the only thing that worked for me using the C# sdk- had to remove 'Unit = StandardUnit.Seconds'- then everything worked fine
    – mdegges
    Apr 30, 2018 at 23:04
3

Make sure that the alarm's Namespace is 'AWS/EC2'.

I know this is a long time after the original question, but in case others find this via Google, I had the same problem, and it turned out I set alarm's Namespace improperly.

1
  • +1 This was really important. Without that alarm was stuck into INSUFFICIENT_DATA state. Thanks!
    – douglaslps
    Jun 30, 2014 at 13:15
2

It is needed to publish data with the same unit used to create the alarm. If you didn't specify one, it will be a <None> unit.

Unit can be specified in aws put-metric-data and aws-put-metric-alarm with --unit <value>

Unit <value> can be:

  • Seconds
  • Bytes
  • Bits
  • Percent
  • Count
  • Bytes/Second (bytes per second)
  • Bits/Second (bits per second)
  • Count/Second (counts per second)
  • None (default when no unit is specified)

Units are also case-sensitive, be carefull about that in your scripts.

For CPUUtilization, you can use Percent.

After the first data-set is sent to your alarm (it can take up to 5 minutes for a non-detailed monitored instance), the alarm will switch to the OK or ALARM state instead of the INSUFFICIENT_DATA one.

1

I am having the same INSUFFICIENT_DATA alarm state show up in CloudWatch for an RDS CPUUtilization > 60 alarm created with CloudFormation. ("Reason: Unchecked: Initial alarm creation" shows up under details). This is a very crude fix but I found that by selecting the alarm, clicking the Modify button, and then the Save button (without changing anything) the alarm goes to the OK state and everything is file.

1

I had this problem. Make sure the metric name you use to create the alarm matches the actual metric name.

You can list your metrics with:

aws cloudwatch list-metrics --namespace=<NAMESPACE, e.g. System/Linux, etc>

Find the metric and the MetricName. Make sure your alarm is configured for that metric.

1

There is a directory /var/tmp/aws-mon/ that contains a couple files. One is instance-id. The instance I was on was created from an AMI and this file retained the old instance id. I just edited it and made sure /var/tmp/aws-mon/placement/availability-zone was also correct. The alarms changed to OK almost instantly.

1

As far as I know, default metric resolution is 5 minutes (which can be lowered to 1 minute if you pay up, or something like that), so if your alarm's measurement period is lower than that, then it'll remain permanently in an INSUFFICIENT_DATA state. In my case, I had a 1 minute measurement period on CPU utilization, and changing it to 5 minutes has fixed the state issue.

1

I had a similar problem, my alarm was constantly in INSUFFICIENT_DATA status although I can see the metric in the GUI.

Come out that this happen, because I specified the wrong Unit for the metric, when I created the Alarm. No error was reported back but it never became GREEN.

Better to avoid to specify it, if you are not sure, and AWS will do the correct match in the background.

0
0

Also ran into this problem but for a different reason: I passed ES cluster ARN instead of domain name in my Cloudformation template. It was pretty frustrating

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.