Home > OS >  To import AWS cli json output into a dashboard
To import AWS cli json output into a dashboard

Time:12-12

I am creating a script to get some details from different AWS resources. The AWS-cli commands returns a json output like below (output of 7 days CPU utilisation of ec2 instances) -:

    {
    "Label": "CPUUtilization",
    "Datapoints": [
        {
            "Timestamp": "2021-12-10T16:18:00 00:00",
            "Average": 0.10045197740112988,
            "Unit": "Percent"
        }
    ]
}
{
    "Label": "CPUUtilization",
    "Datapoints": [
        {
            "Timestamp": "2021-12-10T16:18:00 00:00",
            "Average": 0.12184103236292673,
            "Unit": "Percent"
        }
    ]
}

Is there any way that i can import this data to a dashboard where i can visualize these values ?

If not directly to dashboard then what is the correct way of achieving this "display via dashboard" thing ?

CodePudding user response:

You're looking for Amazon CloudWatch dashboards, which are built exactly for monitoring these sorts of metrics.

Amazon CloudWatch dashboards are customizable home pages in the CloudWatch console that you can use to monitor your resources in a single view, even those resources that are spread across different Regions.

You can use CloudWatch dashboards to create customized views of the metrics and alarms for your AWS resources.

The docs will be a good place to start.

CodePudding user response:

go with couldwatch metric API, using simple REST call you will get the data. please refer below doc.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html

sample doc for put data: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html

hope this will help you to start.

  • Related