{"id":2517,"date":"2021-04-04T18:20:01","date_gmt":"2021-04-04T11:20:01","guid":{"rendered":"http:\/\/vticloud.io\/?p=2517"},"modified":"2021-09-20T10:01:15","modified_gmt":"2021-09-20T03:01:15","slug":"amazon-cloudwatch-custom-metrics","status":"publish","type":"post","link":"https:\/\/vticloud.io\/en\/amazon-cloudwatch-custom-metrics\/","title":{"rendered":"Amazon CloudWatch Custom Metrics"},"content":{"rendered":"<p><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">On AWS, with basically any EC2 instance using Amazon CloudWatch, you can access default metrics and monitor the CPU, Network, Disk usage (I\/O, not the available hard disk space), and status of the individual virtual machine. What you can&#8217;t monitor with default metrics, however, is RAM Utilization (or Storage of virtual disks). This is instead executed using <strong>custom metrics<\/strong>, and in this article, we\u2019re going to find out how to install a custom metric on our EC2 instance.<\/span><\/p>\n<h2><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Take a look back at Amazon CloudWatch<\/span><\/h2>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">As mentioned in the article: <a href=\"https:\/\/vticloud.io\/en\/gioi-thieu-ve-amazon-cloudwatch-phan-2\/\">Amazon CloudWatch Introduction (Part 2) | VTI CLOUD<\/a><\/span><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Standard monitoring is every<strong> 5 minutes<\/strong> and Detailed monitoring is every <strong>1 minute.<\/strong><\/span><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">The key idea here is to create a custom metric that transfers data to Amazon CloudWatch every minute.<\/span><\/p>\n<h2><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">How to create Custom Metrics of Amazon CloudWatch<\/span><\/h2>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Firstly, you would need to log into the AWS console, select the region, provide an EC2 instance and send some custom metrics up to Amazon CloudWatch.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">In order to do that, we need permission to talk to Amazon CloudWatch so we need to:<\/span><\/p>\n<h3><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><strong>A. Create a Role for EC2 Instance<\/strong><\/span><\/h3>\n<ol class=\"ak-ol\">\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Go over to Identity Access Management (<strong>IAM<\/strong>).<\/span><\/p>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Go to <strong>Roles<\/strong> and create a new one.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\" data-pm-slice=\"0 0 []\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\" data-pm-slice=\"0 0 []\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\" data-pm-slice=\"0 0 []\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\" data-pm-slice=\"0 0 []\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\" data-pm-slice=\"0 0 []\">\n<div title=\"Attachment\" data-id=\"58097d30-b863-44b7-9e03-f2997fc46706\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1897\" data-height=\"668\" data-file-name=\"1.png\" data-file-size=\"129580\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2492 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1.png\" alt=\"\" width=\"1897\" height=\"668\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1.png 1897w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1-300x106.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1-1024x361.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1-768x270.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/1-1536x541.png 1536w\" sizes=\"(max-width: 1897px) 100vw, 1897px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">The service that\u2019s going to use this role is <strong>EC2<\/strong>, go ahead and hit <strong>Next<\/strong>.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"718ce49b-bb5e-48db-8ac4-500dcf13279a\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1903\" data-height=\"920\" data-file-name=\"2.png\" data-file-size=\"187843\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2493 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2.png\" alt=\"\" width=\"1903\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2.png 1903w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2-300x145.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2-1024x495.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2-768x371.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/2-1536x743.png 1536w\" sizes=\"(max-width: 1903px) 100vw, 1903px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Choose \u2018<strong>Create Policy<\/strong>\u2019<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"f8f98214-38b0-48e7-9be6-9935a40d9fd2\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1920\" data-height=\"891\" data-file-name=\"3.png\" data-file-size=\"103113\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2494 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3.png\" alt=\"\" width=\"1920\" height=\"891\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3.png 1920w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3-300x139.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3-1024x475.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3-768x356.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/3-1536x713.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">On Create Policy page, choose <strong>JSON tab<\/strong> and complete the following fields and move to the next step.<\/span><\/p>\n<blockquote>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\"><span class=\"CodeMirror-widget\" role=\"presentation\">{<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">   <span class=\"cm-string cm-property\">\"Version\"<\/span>:<span class=\"cm-variable has-error structure-1-13 is-start\">\u201c2012<\/span><span class=\"cm-operator has-error structure-1-13\">-<\/span><span class=\"cm-number has-error structure-1-13\">10<\/span><span class=\"cm-operator has-error structure-1-13\">-<\/span><span class=\"cm-number has-error structure-1-13\">17<\/span><span class=\"cm-variable has-error structure-1-13 is-end\">\u201d<\/span>,<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">   <span class=\"cm-string\">\"Statement\"<\/span>:<span class=\"CodeMirror-widget\" role=\"presentation\">[<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">      <span class=\"CodeMirror-widget\" role=\"presentation\">{<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">         <span class=\"cm-string\">\"Action\"<\/span>:<span class=\"CodeMirror-widget\" role=\"presentation\">[<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">            <span class=\"cm-string\">\"\u201ccloudwatch\"<\/span><span class=\" has-error structure-5-25 is-start is-end\">:<\/span><span class=\"cm-string\">\"PutMetricData\u201d\"<\/span>,<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">            <span class=\"cm-string\">\"\u201cec2\"<\/span><span class=\" has-error structure-6-18 is-start is-end\">:<\/span><span class=\"cm-string\">\"DescribeTags\u201d\"<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">         ],<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">         <span class=\"cm-string\">\"Effect\"<\/span>:<span class=\"cm-string\">\"Allow\"<\/span>,<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">         <span class=\"cm-string\">\"Resource\"<\/span>:<span class=\"CodeMirror-widget\" role=\"presentation\">[<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">            <span class=\"cm-string\">\"*\"<\/span><\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">         ]<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">      }<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif; color: #e83e8c;\"><code><span role=\"presentation\">   ]<\/span><\/code><\/span><\/pre>\n<pre class=\" CodeMirror-line \" role=\"presentation\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code><span role=\"presentation\"><span style=\"color: #ff0000;\"><span style=\"color: #e83e8c;\">}<\/span><\/span><\/span><\/code><\/span><\/pre>\n<\/blockquote>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"e82e5d5e-61e7-414c-b4de-f6e5b5c985ac\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1905\" data-height=\"920\" data-file-name=\"4.png\" data-file-size=\"73994\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2495 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4.png\" alt=\"\" width=\"1905\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4.png 1905w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4-300x145.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4-1024x495.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4-768x371.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/4-1536x742.png 1536w\" sizes=\"(max-width: 1905px) 100vw, 1905px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Add tags if you\u2019d like to and hit next to the review the whole Policy.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"f23bce1b-567b-43ca-9e69-d392a191bdbd\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1907\" data-height=\"921\" data-file-name=\"5.png\" data-file-size=\"59721\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2496 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5.png\" alt=\"\" width=\"1907\" height=\"921\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5.png 1907w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5-300x145.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5-1024x495.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5-768x371.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/5-1536x742.png 1536w\" sizes=\"(max-width: 1907px) 100vw, 1907px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">The final step to create a Policy is choose a <strong>Policy name<\/strong> and <strong>Create Policy<\/strong>. You can also take a look at the policy\u2019s permissions on the Summary table.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"759a0440-639b-4c27-893a-14174979a102\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1905\" data-height=\"919\" data-file-name=\"6.png\" data-file-size=\"96280\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2497 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6.png\" alt=\"\" width=\"1905\" height=\"919\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6.png 1905w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6-300x145.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6-1024x494.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6-768x370.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/6-1536x741.png 1536w\" sizes=\"(max-width: 1905px) 100vw, 1905px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">After the notification of successfully created a Policy, <strong>go back<\/strong> to the Create Role page and hit <strong>refresh<\/strong> button on the top right, <strong>search<\/strong> for the name of the Policy you have created, <strong>tick on the box<\/strong> and hit <strong>next<\/strong> to attach that Policy to the Role.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"3fc49b26-23ba-48d7-b87d-1d55c8380831\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1918\" data-height=\"922\" data-file-name=\"7.png\" data-file-size=\"70384\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2498 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7.png\" alt=\"\" width=\"1918\" height=\"922\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7.png 1918w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7-1024x492.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7-768x369.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/7-1536x738.png 1536w\" sizes=\"(max-width: 1918px) 100vw, 1918px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Add tags if you\u2019d like to and hit next to the review the Role.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"5ac653b8-2543-4d05-93bd-a223e69d5f95\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1920\" data-height=\"921\" data-file-name=\"8.png\" data-file-size=\"66056\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2499 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8.png\" alt=\"\" width=\"1920\" height=\"921\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8.png 1920w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8-1024x491.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8-768x368.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/8-1536x737.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Choose a Role name, describe the Role function and hit Create role.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"a64811a3-4b6a-4b4b-a45c-2587a0840e5f\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1919\" data-height=\"920\" data-file-name=\"9.png\" data-file-size=\"83382\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2500 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9.png\" alt=\"\" width=\"1919\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9.png 1919w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9-1024x491.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9-768x368.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/9-1536x736.png 1536w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">We\u2019ve created a Role and you can find it here at IAM,Roles, it\u2019s gonna be pretty basic JSON.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"410d11ea-8f68-44ae-becb-607635bdb423\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1904\" data-height=\"928\" data-file-name=\"11.png\" data-file-size=\"156851\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2502 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11.png\" alt=\"\" width=\"1904\" height=\"928\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11.png 1904w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11-300x146.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11-1024x499.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11-768x374.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/11-1536x749.png 1536w\" sizes=\"(max-width: 1904px) 100vw, 1904px\" \/><\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><strong>B. Attach the Role you have created to an EC2 Instance<\/strong><\/span><\/h3>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Next, we will take additional steps to attach that Role to your EC2 Instance, and push the metrics to Amazon CloudWatch.<\/span><\/p>\n<ol class=\"ak-ol\">\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Go over to the EC2 console and <strong>provision<\/strong> a EC2 Instance<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Ch\u1ecdn Amazon Linux 2 AMI<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"e6005fc8-4e41-4b65-88f1-43077aed43cf\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1912\" data-height=\"920\" data-file-name=\"12.png\" data-file-size=\"264376\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2503 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12.png\" alt=\"\" width=\"1912\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12.png 1912w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12-1024x493.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12-768x370.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/12-1536x739.png 1536w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Choose Instance Type, hit next<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"b59c9238-8230-40d7-8062-b05706263702\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1914\" data-height=\"920\" data-file-name=\"13.png\" data-file-size=\"187073\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2504 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13.png\" alt=\"\" width=\"1914\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13.png 1914w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13-1024x492.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13-768x369.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/13-1536x738.png 1536w\" sizes=\"(max-width: 1914px) 100vw, 1914px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">In Configure Instance Details, IAM Role, choose the Role you\u2019ve <strong>just created<\/strong><\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"530b262f-a50d-49f2-b167-c23d379f1933\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1912\" data-height=\"922\" data-file-name=\"14.png\" data-file-size=\"200533\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2505 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14.png\" alt=\"\" width=\"1912\" height=\"922\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14.png 1912w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14-300x145.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14-1024x494.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14-768x370.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/14-1536x741.png 1536w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">In Advanced Details, User data, we\u2019re going to <strong>run a bootstrap<\/strong> script provided bellow.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"0cc67935-45da-439c-81cb-fbaabb111266\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1910\" data-height=\"918\" data-file-name=\"15.png\" data-file-size=\"180335\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2506 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15.png\" alt=\"\" width=\"1910\" height=\"918\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15.png 1910w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15-1024x492.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15-768x369.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/15-1536x738.png 1536w\" sizes=\"(max-width: 1910px) 100vw, 1910px\" \/><\/span><\/div>\n<\/div>\n<blockquote>\n<p>\n<span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>#!\/bin\/bash<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>yum update -y<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>sudo yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>cd \/home\/ec2-user\/<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>curl <a href=\"https:\/\/aws-cloudwatch.s3.amazonaws.com\/downloads\/CloudWatchMonitoringScripts-1.2.2.zip\">https:\/\/aws-cloudwatch.s3.amazonaws.com\/downloads\/CloudWatchMonitoringScripts-1.2.2.zip<\/a> -O<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>unzip CloudWatchMonitoringScripts-1.2.2.zip<\/code><\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>rm -rf CloudWatchMonitoringScripts-1.2.2.zip<\/code><\/span><\/p>\n<\/blockquote>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Let\u2019s look at what does this script do:<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Firstly, it is updating the EC2 Instance with all the security patches<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Secondly, it is installing a bunch of different Perl services and then changing the directory over to \/home\/ec2-user\/<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Finally, it is downloading the Amazon CloudWatch monitoring scripts, and unzipping it and deleting the zip file.<\/span><\/p>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Config the Storage, Tags and Security Group or just leave it as default, Hit \u2018Review and Launch\u2019, download or use your existing Key pair and launch the Instance<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"730f2c5c-87f2-4553-a52e-3f9e334e10ab\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1912\" data-height=\"920\" data-file-name=\"16.png\" data-file-size=\"221804\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2507 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16.png\" alt=\"\" width=\"1912\" height=\"920\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16.png 1912w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16-1024x493.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16-768x370.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/16-1536x739.png 1536w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p data-pm-slice=\"1 1 [&quot;orderedList&quot;,null,&quot;listItem&quot;,null]\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Ssh to the Instance.<\/span><\/p>\n<\/li>\n<\/ol>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">In the terminal, type in \u2018ls\u2019 and we can see the directory is there. That is what the bootstrap script has unzipped and installed.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Go inside that directory, we can notice two files in here: mon-get-instance-stats.pl and mon-put-instance-data.pl<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"8bc8f3e5-2f93-471f-b809-7f06e430a6f1\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1095\" data-height=\"696\" data-file-name=\"17.png\" data-file-size=\"46190\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2508 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/17.png\" alt=\"\" width=\"1095\" height=\"696\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/17.png 1095w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/17-300x191.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/17-1024x651.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/17-768x488.png 768w\" sizes=\"(max-width: 1095px) 100vw, 1095px\" \/><\/span><\/div>\n<\/div>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">To send some data to Amazon CloudWatch, we\u2019re going to use the command:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>sudo \/home\/ec2-user\/aws-scripts-mon\/mon-put-instance-data.pl --mem-util --mem-used --mem-avail --disk-space-util --disk-space-avail --disk-path=\/<\/code><\/span><\/p>\n<\/blockquote>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"755a6246-0464-43fa-9544-a98630fa3714\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1092\" data-height=\"225\" data-file-name=\"18.png\" data-file-size=\"27765\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2509 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/18.png\" alt=\"\" width=\"1092\" height=\"225\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/18.png 1092w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/18-300x62.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/18-1024x211.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/18-768x158.png 768w\" sizes=\"(max-width: 1092px) 100vw, 1092px\" \/><\/span><\/div>\n<\/div>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">For this command, we\u2019re gonna send our memory utilization, used, and available data; also our disk space utilization and available.<\/span><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">And you are able to see that it says successfully reported metrics to Amazon CloudWatch, and the Reference Id.<\/span><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">It can take up to 1 minute for this to appear on the Amazon CloudWatch console.<\/span><\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">For Custom Metrics, we call data having a one-minute granularity is Standard Resolution.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Now we can see a new metric under Custom Namespaces called Linux System, and five new metrics inside for your insance: MemoryUtilization, MemoryAvailable, MemoryUsed, DiskSpaceUtilization, and DiskSpaceAvailable.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"6cbeb71b-5b14-4452-ae21-db0735da25a2\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1920\" data-height=\"918\" data-file-name=\"19.png\" data-file-size=\"122964\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2510 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19.png\" alt=\"\" width=\"1920\" height=\"918\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19.png 1920w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19-300x143.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19-1024x490.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19-768x367.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/19-1536x734.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">You will see only a single data point at the beginning because we\u2019ve only pushed this information into Amazon CloudWatch once.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">What we are going to do is push it in every 1 minute. To do this, you need to edit your crontab file:<\/span><\/p>\n<blockquote>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>sudo nano \/etc\/crontab<\/code><\/span><\/p>\n<\/blockquote>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">and put this command into your crontab<\/span><\/p>\n<blockquote>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><code>*\/1 * * * * root \/home\/ec2-user\/aws-scripts-mon\/mon-put-instance-data.pl --mem-util --mem-used --mem-avail --disk-space-util --disk-space-avail --disk-path=\/<\/code><\/span><\/p>\n<\/blockquote>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"8001b5fa-b605-4335-bf6d-b0b36cf223ce\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1096\" data-height=\"699\" data-file-name=\"20.png\" data-file-size=\"72815\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2511 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/20.png\" alt=\"\" width=\"1096\" height=\"699\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/20.png 1096w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/20-300x191.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/20-1024x653.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/20-768x490.png 768w\" sizes=\"(max-width: 1096px) 100vw, 1096px\" \/><\/span><\/div>\n<\/div>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">By pasting this in here, we\u2019re going to run this command every minute as root and put the information up into Amazon CloudWatch.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Basically you can set it to run a command every minute, every day, week, or month.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">After a while, go back to the Amazon CloudWatch console, choose a metric and you will see we\u2019ve been getting datapoints ever since starting. Be aware that if you don\u2019t have Detailed Monitoring turned on, you will only getting five-minute intervals.<\/span><\/p>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"275b0de9-cb79-4e81-9cdc-156880ffb875\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1919\" data-height=\"919\" data-file-name=\"21.png\" data-file-size=\"171186\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2512 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21.png\" alt=\"\" width=\"1919\" height=\"919\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21.png 1919w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21-1024x490.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21-768x368.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/21-1536x736.png 1536w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/>\u00a0<\/span><\/div>\n<div title=\"Attachment\" data-id=\"275b0de9-cb79-4e81-9cdc-156880ffb875\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1919\" data-height=\"919\" data-file-name=\"21.png\" data-file-size=\"171186\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><img loading=\"lazy\" class=\"alignnone wp-image-2513 size-full\" src=\"http:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22.png\" alt=\"\" width=\"1916\" height=\"922\" srcset=\"https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22.png 1916w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22-300x144.png 300w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22-1024x493.png 1024w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22-768x370.png 768w, https:\/\/vticloud.io\/wp-content\/uploads\/2021\/03\/22-1536x739.png 1536w\" sizes=\"(max-width: 1916px) 100vw, 1916px\" \/><\/span><\/div>\n<\/div>\n<div data-node-type=\"mediaSingle\" data-layout=\"center\" data-width=\"\">\n<div title=\"Attachment\" data-id=\"6a3eea32-f600-4491-9526-e8cea13e4aae\" data-node-type=\"media\" data-type=\"file\" data-collection=\"contentId-1051295752\" data-width=\"1916\" data-height=\"922\" data-file-name=\"22.png\" data-file-size=\"177543\" data-file-mime-type=\"image\/png\" data-context-id=\"1051295752\">\u00a0<\/div>\n<\/div>\n<p data-pm-slice=\"1 1 []\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">The cool thing about Amazon CloudWatch is you can also install these scripts on your on-premise instances and have them sending data to Amazon CloudWatch, and use Amazon CloudWatch as a holistic monitoring tool for both your AWS and on-premise environment.<\/span><\/p>\n<p><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Besides, we can use High Resolution for application that need low granularity (&lt; 60 seconds). Follow VTI Cloud for more topic about Amazon CloudWatch.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">About VTI Cloud<\/span><\/h2>\n<p data-renderer-start-pos=\"6835\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\"><strong data-renderer-mark=\"true\">VTI Cloud<\/strong>\u00a0is an\u00a0<span style=\"color: #ff6600;\"><a class=\"sc-iELTvK jHUAie\" style=\"color: #ff6600;\" title=\"https:\/\/vticloud.io\/news_events\/vti-cloud-chinh-thuc-tro-thanh-advanced-consulting-partner-cua-aws\/\" href=\"https:\/\/vticloud.io\/news_events\/vti-cloud-chinh-thuc-tro-thanh-advanced-consulting-partner-cua-aws\/\" data-renderer-mark=\"true\">Advanced Consulting Partner<\/a>\u00a0<\/span>of AWS Vietnam with a team of over 50+ AWS certified solution engineers. With the desire to support customers in the journey of digital transformation and migration to the AWS cloud, VTI Cloud is proud to be a pioneer in consulting solutions, developing software, and deploying AWS infrastructure to customers<strong data-renderer-mark=\"true\">\u00a0in Vietnam<\/strong>\u00a0<strong data-renderer-mark=\"true\">and Japan.<\/strong><\/span><\/p>\n<p data-renderer-start-pos=\"7217\"><span style=\"font-family: BaiJamjuree-Regular, sans-serif;\">Building safe, high-performance, flexible, and cost-effective architectures for customers is\u00a0<strong data-renderer-mark=\"true\">VTI Cloud\u2019s<\/strong>\u00a0leading mission in enterprise technology mission.<\/span><\/p>\n<div id=\"gtx-trans\" style=\"position: absolute; left: 6px; top: 11292.6px;\">\n<div class=\"gtx-trans-icon\">\u00a0<\/div>\n<\/div>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>On AWS, with basically any EC2 instance using Amazon CloudWatch, you can access default metrics and monitor the CPU, Network, Disk usage (I\/O, not the available hard disk space), and status of the individual virtual machine. What you can&#8217;t monitor with default metrics, however, is RAM Utilization (or Storage of virtual disks). This is instead [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":2554,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[111,46,126,45,109],"_links":{"self":[{"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/posts\/2517"}],"collection":[{"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/comments?post=2517"}],"version-history":[{"count":1,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/posts\/2517\/revisions"}],"predecessor-version":[{"id":3164,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/posts\/2517\/revisions\/3164"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/media\/2554"}],"wp:attachment":[{"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/media?parent=2517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/categories?post=2517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vticloud.io\/en\/wp-json\/wp\/v2\/tags?post=2517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}