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:
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.