{"id":10437,"date":"2022-03-15T02:00:42","date_gmt":"2022-03-15T02:00:42","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=10437"},"modified":"2024-06-25T11:04:02","modified_gmt":"2024-06-25T11:04:02","slug":"resolve-downtime-issues-with-aws-system-manager-custom-metrics","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/resolve-downtime-issues-with-aws-system-manager-custom-metrics","title":{"rendered":"Resolve Downtime Issues with AWS System Manager Custom Metrics"},"content":{"rendered":"<p>Consider a situation where you have a downtime issue arising in your machine. Still, the CPU utilization is average, and you cannot think why it is happening. Then custom metrics will come into the picture; you can set some custom metrics like memory utilization metrics to check the downtime is due to high memory utilization or something else.<\/p>\n<p>The first question that strikes in mind is why we need custom metrics when AWS CloudWatch offers a large variety of matrices for your EC2 instances. Sometimes, you need some custom metrics to visualize your instances to know the exact reason for the downtime.<\/p>\n<p>Well, you can achieve custom metrics set up with the help of AWS System Manager, which makes this setup much more effortless and understandable.<\/p>\n<h2><strong>AWS System Manager<\/strong><\/h2>\n<p>AWS System Manager (very well known as SSM) is an AWS service that helps to view and control operational data on multiple AWS Resources such as a group of EC2, IoT Devices, On-Prem servers, etc.<\/p>\n<p>It helps you maintain security and compliance by scanning your machines and reporting any violations if found.<\/p>\n<h3><strong>Installation of AWS System Manager<\/strong><\/h3>\n<p>By default, AWS SSM is installed on these flavors of EC2 machines-:<\/p>\n<ul>\n<li>Amazon Linux<\/li>\n<li>Amazon Linux 2<\/li>\n<li>Amazon Linux 2 ECS-Optimized Base AMIs<\/li>\n<li>SUSE Linux Enterprise Server (SLES) 12 and 15<\/li>\n<li>Ubuntu Server 16.04, 18.04, and 20.04<\/li>\n<\/ul>\n<p>But if your EC2 doesn\u2019t come in the above category, then you can manually install it on your EC2 server, click below on the basis of your OS, and install it:<\/p>\n<ol>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-al.html\">Amazon Linux<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-al2.html\">Amazon Linux 2<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-centos.html\">CentOS<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-deb.html\">Debian Server<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-oracle.html\">Oracle Linux<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-rhel.html\">Red Hat Enterprise Linux<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-sles.html\">SUSE Linux Enterprise Server<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/systems-manager\/latest\/userguide\/agent-install-ubuntu.html\">Ubuntu Server<\/a><\/li>\n<\/ol>\n<h3><strong>Setting up Custom Metrics<\/strong><\/h3>\n<p><strong>Step -1: <\/strong><\/p>\n<p><strong>Create an EC2 role with these policies<\/strong><\/p>\n<ul>\n<li>CloudWatchAgentServerPolicy<\/li>\n<li>AmazonSSMManagedInstanceCore<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10438\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM1.png\" alt=\"AWS System Manager\" width=\"604\" height=\"286\" \/><\/a><\/li>\n<\/ul>\n<p><strong>Step -2: <\/strong><\/p>\n<p><strong>Attach\u00a0an IAM Role\u00a0to the instances<\/strong><\/p>\n<ul>\n<li>Go to Instance and click on actions<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10439\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM2.png\" alt=\"AWS System Manager\" width=\"604\" height=\"189\" \/><\/a><\/li>\n<li>Click on security<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10440\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM3.png\" alt=\"AWS System Manager\" width=\"482\" height=\"355\" \/><\/a><\/li>\n<li>Click on Modify IAM Role\u00a0and attach the role that you have created<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10441\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM4.png\" alt=\"AWS System Manager\" width=\"505\" height=\"339\" \/><br \/>\n<\/a><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10442\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM5.png\" alt=\"AWS System Manager\" width=\"604\" height=\"360\" \/><\/a><\/li>\n<\/ul>\n<p><strong>Step -3:<\/strong><\/p>\n<p><strong>System Manager<\/strong><\/p>\n<ul>\n<li>Go to system-manager and click on the run command<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10443\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM6.png\" alt=\"AWS System Manager\" width=\"604\" height=\"248\" \/><\/a><br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10444\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM7.png\" alt=\"AWS System Manager\" width=\"604\" height=\"318\" \/><\/a><\/li>\n<li>Select the package<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10445\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM8.png\" alt=\"AWS System Manager\" width=\"604\" height=\"328\" \/><\/a><\/li>\n<li>Keep everything as default and give name as shown, please use the same name as it is case sensitive<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10446\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM9.png\" alt=\"AWS System Manager\" width=\"604\" height=\"297\" \/><\/a><\/li>\n<li>Choose the instance<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10447\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM10.png\" alt=\"AWS System Manager\" width=\"604\" height=\"299\" \/><\/a><\/li>\n<li>Disable S3<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10448\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM11.png\" alt=\"AWS System Manager\" width=\"606\" height=\"137\" \/><\/a><\/li>\n<li>Click on Run<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10449\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM12.png\" alt=\"AWS System Manager\" width=\"604\" height=\"138\" \/><\/a><\/li>\n<li>It will take a couple of seconds to complete<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10450\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM13.png\" alt=\"AWS System Manager\" width=\"604\" height=\"161\" \/><\/a><\/li>\n<\/ul>\n<p class=\"paragraph\" style=\"margin: 0cm; vertical-align: baseline;\"><span class=\"normaltextrun\"><b><span lang=\"EN-US\" style=\"font-size: 14.0pt; font-family: 'Calibri',sans-serif;\">Step -4:<\/span><\/b><\/span><\/p>\n<p class=\"paragraph\" style=\"margin: 0cm; vertical-align: baseline;\"><span class=\"normaltextrun\"><b><span lang=\"EN-US\" style=\"font-size: 14.0pt; font-family: 'Calibri',sans-serif;\">Parameter Store<\/span><\/b><\/span><\/p>\n<ul>\n<li>Click on parameter store\u00a0to store the configuration\u00a0from the left navigation<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10451\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM14.png\" alt=\"AWS System Manager\" width=\"253\" height=\"355\" \/><\/a><\/li>\n<li>Click on create parameter<\/li>\n<li>Give the same name as given below, it is mandatory to use\u00a0AmazonCloudWatch\u00a0prefix<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10452\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM15.png\" alt=\"AWS System Manager\" width=\"604\" height=\"78\" \/><\/a><\/li>\n<li>In the\u00a0values section put json file\u00a0mentioned below<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10453\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM16.png\" alt=\"AWS System Manager\" width=\"604\" height=\"93\" \/><\/a><\/li>\n<li>Use the json given below in values field and keep everything default and create the\u00a0parameter<\/li>\n<li><a href=\"https:\/\/www.cloudthat.com\/contact-us\/\">Click here to get the JSON code<\/a><\/li>\n<li>Repeat for windows if you have windows instance and give name as given below<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10454\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM17.png\" alt=\"AWS System Manager\" width=\"604\" height=\"134\" \/><\/a><\/li>\n<li>Paste the windows config\u00a0in values<\/li>\n<li>Copy\u00a0both\u00a0parameter name in a notepad<\/li>\n<li>Go to Run command again in left navigation<\/li>\n<li>Go to the 4\u2019rth page and select\u00a0Amazon-cloudwatch-manage-agent as shown below<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10455\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM18.png\" alt=\"AWS System Manager\" width=\"604\" height=\"347\" \/><\/a><\/li>\n<li>Paste\u00a0the name as you have copied, paste windows parameter name as shown below and keep everything default<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM19.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10456\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM19.png\" alt=\"AWS System Manager\" width=\"604\" height=\"59\" \/><\/a><\/li>\n<li>Choose the windows instance as we are\u00a0setting up for windows one<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM20.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10458\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM20.png\" alt=\"AWS System Manager\" width=\"604\" height=\"331\" \/><\/a><\/li>\n<li>Disable S3 and keep everything as default and click on run<\/li>\n<li>Wait for a few\u00a0seconds\u00a0it will complete<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM21.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10459\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM21.png\" alt=\"AWS System Manager\" width=\"604\" height=\"162\" \/><\/a><\/li>\n<li>Repeat the process for\u00a0Linux\u00a0one<\/li>\n<li>Give the\u00a0Linux\u00a0parameter name as you stored<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10460\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM22.png\" alt=\"AWS System Manager\" width=\"604\" height=\"66\" \/><\/a><\/li>\n<li>Choose the instance and disable the s3\u00a0and click on Run, Keep all as default<\/li>\n<li>Wait for a few\u00a0minutes\u00a0it will\u00a0succeed\u00a0the\u00a0installation<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM23.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10461\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM23.png\" alt=\"AWS System Manager\" width=\"604\" height=\"147\" \/><\/a><\/li>\n<li>After 5-10 minutes go to\u00a0CloudWatch\u00a0click on metrics and select all metrics<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/smnew.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10462\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/smnew.png\" alt=\"AWS System Manager\" width=\"233\" height=\"131\" \/><\/a><\/li>\n<li>There are 2 custom metrics<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM24.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10463\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM24.png\" alt=\"AWS System Manager\" width=\"604\" height=\"112\" \/><\/a><\/li>\n<li>You can well go through each and see your custom metrics<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM25.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10464\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/SM25.png\" alt=\"AWS System Manager\" width=\"361\" height=\"229\" \/><\/a><\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>In this world of competition, where there is no room for a lag of your website or serious downtime, you will lose your potential customers who will switch to your competitors. So make your website completely free from such issues by significantly decreasing the downtime, making your application highly available with frequent releases. CloudThat\u2019s team of experts can help you set up a highly available and scalable infrastructure. In addition, we have a special managed service team that will monitor your Infrastructure and resolve issues as soon as possible so that you can focus on your business more than downtime problems.<\/p>\n<h3>About CloudThat<\/h3>\n<p>Here at\u00a0<a href=\"https:\/\/www.cloudthat.com\/\"><strong>CloudThat<\/strong>\u00a0<\/a>are the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge on cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build\u00a0a robust\u00a0cloud computing ecosystem by disseminating\u00a0knowledge on technological intricacies within the cloud space.\u00a0Our blogs, webinars,\u00a0case studies, and white papers\u00a0enable all the stakeholders in the cloud computing sphere.<\/p>\n<p>Feel free to drop a comment or any queries you have regarding AWS services, cloud adoption, consulting, and we will get back to you quickly. To get started, go through\u00a0our\u00a0<a href=\"https:\/\/www.cloudthat.com\/expert-advisory\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=expert-advisory\"><strong>Expert Advisory\u00a0<\/strong><\/a>page\u00a0and\u00a0<a href=\"https:\/\/www.cloudthat.com\/managed-services-packages\/\"><strong>Managed Services Package<\/strong><\/a><strong>\u00a0<\/strong>that is\u00a0<a href=\"https:\/\/cloudthat.com\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=cloudthat.com\/\"><strong>CloudThat<\/strong><\/a><strong>\u2019s<\/strong>\u00a0offerings.<\/p>\n","protected":false},"author":256,"featured_media":10784,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3606,3607],"user_email":"rishir@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/10437"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/256"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=10437"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/10437\/revisions"}],"predecessor-version":[{"id":41905,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/10437\/revisions\/41905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=10437"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=10437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}