Can I see EC2 Instance Monitoring Metrics in Cloudwatch by adding values in Parameter Store?

0

By adding a specific value in Parameter Store in AWS System Manager Is there any way to add the below EC2 basic monitoring metrics?

CPUUtilzation, StatusCheckFailed, StatusCheckFailed_Instance, StatusCheckFailed_System NetworkIn, NetworkOut, NetworkPacketsIn, NetworkPacketsOut EBSReadBytes, EBSReadOps, EBSWriteBytes, EBSWriteOps

{
  "agent": {
    "metrics_collection_interval": 60,
    "region": "ap-northeast-2",
    "run_as_user": "root"
  },
  "logs": {
    "logs_collected": {
      "files": {
        "collect_list": [
          {
            "file_path": "/var/log/syslog",
            "log_group_name": "DevSystemLogs",
            "log_stream_name": "syslog"
          },
          {
            "file_path": "/var/log/auth.log",
            "log_group_name": "DevSystemLogs",
            "log_stream_name": "authlog"
          },
          {
            "file_path": "/var/log/cmdlog.log",
            "log_group_name": "DevSystemLogs",
            "log_stream_name": "cmdlog"
          }
        ]
      }
    }
  },
  "metrics": {
    "namespace": "Dev/custom",
    "append_dimensions": {
      "ImageID": "${aws:ImageId}",
      "InstanceId": "${aws:InstanceId}",
      "InstanceType": "${aws:InstanceType}",
      "AutoScalingGroupName": "${aws:AutoScalingGroupName}"
    },
    "metrics_collected": {
          "cpu": {
            "resources": [
              "*"
            ],
            "measurement": [
            ],
            "totalcpu": true,
            "metrics_collection_interval": 10,
            "append_dimensions": {
              "osw_test5": "osw_test5"
            }
          },
      "disk": {
        "measurement": [
          "used_percent"
        ],
        "metrics_collection_interval": 60,
        "resources": [
          "*"
        ]
      },
      "mem": {
        "measurement": [
          "mem_used_percent"
        ],
        "metrics_collection_interval": 60
      }
    }
  }
}

I would like to see the above metrics when I clicked all metrics in Cloudwatch and clicked Custom Namespace

1 Answer
0

Hopefully I understand your question, but you can store Cloudwatch Configuration in AWS Systems Manager (SSM) Parameter Store and use SSM to configure the CloudWatch Agent to push the metrics and logs you desire to CloudWatch. You will want to use the AmazonCloudWatch-ManageAgent run command document. Documentation and workshops below demonstrate that process. Hope this helps.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-on-EC2-Instance-fleet.html#start-CloudWatch-Agent-EC2-fleet

https://www.wellarchitectedlabs.com/security/200_labs/200_remote_configuration_installation_and_viewing_cloudwatch_logs/4_start_cw_agent/

https://catalog.us-east-1.prod.workshops.aws/workshops/a8e9c6a6-0ba9-48a7-a90d-378a440ab8ba/en-US/300-ssm/330-state-manager/331-using-state-manager

profile pictureAWS
aaron_l
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions