0

I am trying to configure custom metrics for windows server in EC2. I need memory utilization and free disk space metrics from perfmon. So, the document says we can use AWS SSM and cloudwatch agent to push these metrics. Have enabled SSM and attached role and everything on EC2. The config file I created in the path "C:\Program Files\Amazon\AmazonCloudWatchAgent\" is amazon-cloudwatch-agent.json. The contents of this file are:

{
"agent": {
    "metrics_collection_interval": 10,
    "logfile": "c:\\Program Files\\Amazon\\CloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log"
  },
"metrics": {
"metrics_collected": {
  "statsd": {},
  "LogicalDisk": {
    "measurement": [
      {"name": "Free Megabytes", "unit": "String"},
      {"name": "LogicalDisk % Disk Read Time", "rename": "DISK_READ"},
      "% Disk Write Time"
    ],
    "resources": [
      "*"
    ]
  },
  "Memory": {
    "metrics_collection_interval": 5,
    "measurement": [
      "Available MBytes"
    ],
    "append_dimensions": {
      "d3": "win_bo"
    }
  },
"append_dimensions": {
  "InstanceId": "${aws:InstanceId}"
},
"aggregation_dimensions" : [["InstanceId"], ["d1"],[]]
}
}
}

Now, when I try to push this config file to cloudwatch agent using command line ".\amazon-cloudwatch-agent-ctl.ps1 -a fetch-config -m ec2 -c file:.\amazon-cloudwatch-agent.json", I get an error as attached here:

enter image description here

Can someone please guide me to achieve what I am looking for. I am not sure about this error, and stuck here. Any support would be highly appreciated.

  • I'd take metrics out of the file until it works, then you can diagnose the one that's not working. – Tim Nov 20 '19 at 17:53
0

Yes, the Cloudwatch Agent error messages are quite misleading.

I think the problem is with your "Free Megabytes" measurement - try "% Free Space" instead. The name should match the name of the metric in Performance Monitor. Possibly some of your other measurements are also incorrect.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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