Cloudwatch agent windows

Cloudwatch agent windows DEFAULT

Download and configure the CloudWatch agent using the command line

ArchitecturePlatformDownload linkSignature file link

x86-64

Amazon Linux and Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Centos

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Debian

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Oracle

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

macOS

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3..amazonaws.com/amazoncloudwatch-agent-/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

x86-64

Windows

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3..amazonaws.com/amazoncloudwatch-agent-/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

ARM64

Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

ARM64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-suse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

Sours: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/download-cloudwatch-agent-commandline.html

How to Install and Configure the AWS CloudWatch Agent on a Windows Server

aws cloudwatch

Cloud servers don’t have to be Linux-based—Windows server workloads are able to run in AWS and are compatible with most of the built-in services that Amazon offers, including their CloudWatch monitoring tools, though you will have to install the agent manually.

Running servers in on-prem data center may mean having an infrastructure-monitoring solution that runs alongside each server. This solution often consumes just as many resources as the application it’s supposed to be monitoring!

In the Amazon Web Services (AWS) cloud, the same robust monitoring and logging exists without needing to worry about provisioning extra resources or configuring access. AWS’s solution to this problem is CloudWatch.

CloudWatch is an AWS service that captures the logs and server metrics from various sources. CloudWatch collects information from resources like EC2 (Elastic Compute Cloud) instances or on-prem servers. It then consolidates them into one central location in AWS.

By the end of this tutorial, you’ll be able to install the AWS CloudWatch agent on a Windows EC2 instance and configure it to send logs into CloudWatch.

Prerequisites

To follow along, you’ll need the following:

  1. An AWS Account
  2. A 64-bit Windows Server EC2 instance OR an on-prem server running Server 2008 or later
  3. The key file associated with the instance (EC2 instances only)

Connecting to a Windows EC2 Instance

The first step in setting up CloudWatch is installing the CloudWatch agent. The agent is what sends information back to AWS that your server generates. Before you can do that though, you first need to connect to your Windows EC2 instance.

To connect to a Windows EC2 instance, you’ll need to get two pieces of information from the EC2 section in your AWS console for the Windows instance you want to login to: the Public DNS name and the key file associated with the instance.

Once you have those, go into the EC2 service from the AWS console, right-click on the instance, then select “Get Windows Password.” Once here, you’ll be prompted for the key file, and if you have the correct one, it will get you to the screen below.

You have the correct key file if you see the screen shown.If you or another administrator has already changed this password, or you don’t have access to the key file, then right-click on the instance, select “Terminate” and start over. There is no recovering keys once they are lost, and not even Amazon can recover them for you.

That being said, if you are able to retrieve the Windows password, copy it and save it for later in a password manager. Now, open a remote desktop client and log in to the server by using the Public DNS name from earlier with the credentials above. If you did everything correctly, you should see a familiar sight: The Windows server desktop.

The Windows server desktop.

Installing the CloudWatch Agent

Now that you’ve RDP’d into the instance, you can start installing the CloudWatch agent. To do so, Amazon provides you with a prebuilt .msi installer to use. Per the CloudWatch documentation, you can see under Download Link under each architecture that there are two different URLs for it: one regional and one general use. Either will work for this tutorial.

Start by opening a PowerShell window on your EC2 instance and entering the commands below. The first command will download the CloudWatch installer to the local user profile and the second will execute the installer.

Once the installer has been run, you’ll notice that a new Windows service for CloudWatch is installed on the server. This service is what allows CloudWatch to run in the background collecting the information it needs to.

Confirm that the service has been installed and is not running by using the cmdlet in the screenshot below. Don’t start it yet, you’ll need to configure it first, which you’ll do that in the next section.

Confirm that the service has been installed and is not running by using the Get-Service cmdlet.

Configuring CloudWatch

Now that the CloudWatch agent is installed, you’ll need to tell it what to report back. In addition to the preselected metrics, Amazon allows you to create custom metrics, send logs, and even report back events from Windows Event Viewer. It would be very computationally expensive to send everything back all the time and make a lot of noise. By setting a configuration, you can tell AWS what things are important and what to watch.

Amazon uses a JSON configuration file to direct the agent on which logs and metrics to collect. If you are already familiar with making these files or have been given a premade one by your organization, then you can use that. If creating configuration files is not something you are familiar with, Amazon also provides a wizard to get started.

To start the wizard, you’ll need to run it from the CloudWatch install directory. Go back to the PowerShell console and enter This command will start the wizard in an interactive session, and after answering a few questions, it will generate a JSON file with the configuration.

By default, the wizard saves the config file to the user profile as config.json, but it’s also possible to save them to the AWS Systems Manager. The Systems Manager will allow you to have the same configuration versioned and easily accessible to several instances at a time, but requires that the AWS configuration is done for each of those instances.

Following is a sample configuration file generated by the wizard. Your file might be a little different; the file below is only a basic example.

Starting the CloudWatch Agent

Now that the service has been installed and the configuration has been set, you can start the agent. Inside of your open PowerShell console, change into the CloudWatch directory by running and then run the command below to start the CloudWatch agent with the config file you just created on an EC2 instance. This command will take the config file generated by the wizard and start the service with those settings.

If you now rerun the cmdlet from earlier, you will see that the CloudWatch agent service is now running as shown below.

The CloudWatch agent service is now running.

Additionally, if you go to the CloudWatch page in the AWS console, under the “Metrics” section on the left, select the “All-Metrics” tab, then go under All > EC2 > Per-Instance Metrics, you will see your instance metrics reporting to CloudWatch as shown below.

Instance metrics reporting to CloudWatch.

Conclusion

You should now be able to set up AWS CloudWatch on Windows EC2 instances. With some small changes to the commands, the same process will work for on-prem servers, too. From here, you can set up alarms to alert you if something goes wrong, log groups to aggregate application logs from your servers, and automate the installation of the CloudWatch agent using PowerShell.

Sours: https://www.cloudsavvyit.com/3250/how-to-install-and-configure-the-aws-cloudwatch-agent-on-a-windows-server/
  1. Matching frog rings
  2. Farmhouse house plan
  3. Nov 4 zodiac
  4. 2010 ultra classic value

Cloudwatch Agent Manual Install

  1. We are now going to manually install the CloudWatch agent to start collecting memory data, to start let’s go back to the Amazon EC2 Dashboard. Images/MemInstall01.png

  2. On the left bar, click on Instances and select the EC2 Instance with the CloudWatchAgentServerRole IAM role. Images/MemInstall02.png

  3. Connect into the EC2 Instance using the browser-based SSH connection tool. Images/MemInstall03.pngImages/MemInstall04.pngImages/MemInstall05.png

  4. Download the Amazon Cloudwatch agent package, the instructions below are for Amazon Linux, for other OS please check here

Images/MemInstall06.png

  1. Unzip and Install the package

Images/MemInstall07.png

  1. Configure the AmazonCloudWatchAgent profile

Before running the CloudWatch agent on any servers, you must create a CloudWatch agent configuration file, which is a JSON file that specifies the metrics and logs that the agent is to collect, including custom metrics. You can create it by using the wizard or by writting it yourself from scratch. Any time you change the agent configuration file, you must then restart the agent to have the changes take effect.

The wizard can autodetect the credentials and AWS Region to use if you have the AWS credentials and configuration files in place. For more information about these files, see Configuration and Credential Files in the AWS Systems Manager User Guide and the AWS documentation page .

For now, let’s start the CloudWatch agent configuration file wizard executing the command below at the selected EC2 instance.

Images/MemInstall08.png

For this lab we want to keep the following structure:

CloudWatch Agent Configutation File WizardParameter
On which OS are you planning to use the agent?1. Linux
Are you using EC2 or On-Premises hosts?1. EC2
Which user are you planning to run the agent?2. cwagent
Do you want to turn on StatsD daemon?2. No
Do you want to monitor metrics from CollectD?2. No
Do you want to monitor any host metrics?1. Yes
Do you want to monitor cpu metrics per core?2. No
Do you want to add ec2 dimensions?1. Yes
Would you like to collect your metrics at high resolution?4. 60s
Which default metrics config do you want?1. Basic
Are you satisfied with the above config?1. Yes
Do you have any existing CloudWatch Log Agent?2. No
Do you want to monitor any log files?2. No
Do you want to store the config in the SSM parameter store?2. No

The CloudWatch Agent config file should look like the following:

  1. Start the CloudWatch Agent

Images/MemInstall09.png

It may take up to 5 minutes for the metrics to become available, go back to the Amazon CloudWatch console page, under the Metrics session to validate that you are getting Memory information.

Click CWAgent: Images/MemInstall10.png

Click ImageID,InstanceID,InstanceType: Images/MemInstall11.png

Select the Instance from the list below: Images/MemInstall12.png

You have now completed the CloudWatch agent installation and will be able to monitor on Amazon CloudWatch the memory utilization of that instance.

[BONUS] The next step is not mandatory to complete this lab.

If you have a lot of instances manually installing the CloudWatch agent in each of them is not a scalable option, instead consider using a pre-configured AWS CloudFormation template to automatically install the CloudWatch agent by default on all your stack. As an example on how to do that check the following steps:

  • Right-click and save link as: here to download the AWS Cloudformation template

  • Go to the AWS CloudFormation console

  • Click to Create Stack and select Upload a template file and point to the downloaded file

  • Enter a Stack Name and select a KeyName

  • Enter the tag Key: Event | Value: myStackforWACostLab

  • Click Next and Create stack

Sours: https://www.wellarchitectedlabs.com/cost/200_labs/200_aws_resource_optimization/4_memory_plugin/

Install and configure Amazon CloudWatch Agent on EC2 instances

The Amazon CloudWatch Agent enables you to collect metrics, custom metrics, and logs from within Windows and Linux EC2 instances. This step-by-step guide explains how to install and configure the Amazon CloudWatch Agent on EC2 instances.

Mohamed Wali

Mohamed is a cloud infrastructure expert with experience in engineering and implementation in AWS and Azure. He currently works as a Cloud Infrastructure Architect at Amazon Web Services.

Latest posts by Mohamed Wali (see all)

Prerequisites ^

Before we get started with CloudWatch, you have to follow these steps in AWS:

  • Create an EC2 instance.
  • Ensure that the EC2 instance can reach the SSM endpoint either via public internet or a VPC Endpoint.
  • Attach an IAM role to the EC2 instance that includes the following policies:
    • CloudWatchAgentServerPolicy: This policy enables the EC2 instance to push the logs and metrics to the Amazon CloudWatch service.
    • AmazonSSMManagedInstanceCore: This policy enables the EC2 instance to read parameters stored in the SSM parameter store and to have them registered under the SSM managed instances, so you can RunCommands against it.
  • Ensure that the SSM agent is installed in this EC2 instance.

Install the Amazon CloudWatch Agent on an EC2 instance ^

Navigate to the AWS Systems Manager console.

On the left menu, select Node Management > Run Command. Then click Run command.

RunCommand in Systems Manager Console

RunCommand in Systems Manager Console

In the Command document search bar, choose Documentprefixname, then Equals, and then specify the name of the document as AWS-ConfigureAWSPackage.

Search for the command document

Search for the command document

Then specify the following command parameters:

  • Action: Install
  • InstallationType: Uninstall and Reinstall
  • Name: AmazonCloudWatchAgent
  • Version: Latest
  • Additional Arguments: No additional arguments needed
Specify command parameters

Specify command parameters

Specify command parameters

Under the Targets section, specify the method for selecting the instances in which you want to install the CloudWatch agent. There are three methods:

  • Instance Tags: If the instances you're using are tagged, you can specify one or more instance tag key–value pairs to identify the instances on which the tasks will run.
  • Manually: Manually select the instances on which the tasks will run.
  • Resource Group: If the instances are gathered under, you can specify the resource group on which the tasks will run.
Specify the targets

Specify the targets

If you don't want to store the outputs of this command in an S3 document, you can just uncheck Enable an S3 bucket under Output options.

Finally, click Run.

Once you click Run, you are redirected to a new page where you can monitor the status of the running tasks.

Status of the running tasks

Status of the running tasks

Using this method for installing the CloudWatch agent is highly recommended for instances on scale, where you can install the agent on all the instances at once. The command document we used to install the CloudWatch agent is suitable for Linux, Windows, and MacOS. So you don't have to worry about segregating the different platforms while provisioning the agent.

Configure the CloudWatch Agent ^

Once the agent is installed, the next step is to configure it to push the logs and metrics to CloudWatch.

To configure the CloudWatch agent, you need to create a configuration file. You can create it by running the CloudWatch Agent Configuration Wizard, which you can start by entering the following command:

Linux

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard

Windows:

cd "C:\\Program Files\\Amazon\\AmazonCloudWatchAgent" amazon-cloudwatch-agent-config-wizard.exe

All you need to do is answer the wizard questions to generate a customized configuration file for the server you would like to monitor. Otherwise, you can create the configuration file manually by following this guide: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html

It's recommended to store the configuration file as an SSM parameter store in AWS Systems Manager because it provides version control for your stored parameter; therefore, if you modified the value of the parameter, it would create a new version of the parameter while retaining a history of the previous versions.

If you're following the wizard to generate the configuration file, you have the option to store it on SSM. Just ensure you answer Yes when prompted whether to store the file in Systems Manager Parameter Store. However, if you're creating it manually, you can just store it right away as a parameter in the Systems Manager Parameter Store.

If you're creating the configuration file manually, you can store it as a parameter in SSM by following these steps:

  • Navigate to AWS Systems Manager.
  • Under the Application Management section, choose Parameter Store.
  • On the Parameter Store console, click Create Parameter.
  • Specify a Name for the parameter, copy the content of the configuration file, paste in a Value, and you can keep the rest of the options as defaults.

If you use the wizard to write the configuration file to the SSM parameter store, ensure that the IAM role attached to the EC2 instance includes CloudWatchAgentAdminPolicy instead of CloudWatchAgentServerPolicy.

If you're storing the configuration file locally, the configuration file config.json is stored in /opt/aws/amazon-cloudwatch-agent/bin/ on Linux servers and in C:\Program Files\Amazon\AmazonCloudWatchAgent on Windows Servers.

Once the agent is created, you can use it to configure the CloudWatch agent. You can do so by either running this command on the instance or using the Run Command feature of AWS Systems Manager.

To run it locally, use the following commands:

Linux:

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c ssm:<Parameter\_Name\_in\_SSM>

Windows:

& 'C:\\Program Files\\Amazon\\AmazonCloudWatchAgent\\amazon-cloudwatch-agent-ctl.ps1' -a fetch-config -m ec2 -s -c ssm:<Parameter\_Name\_in\_SSM>

If you're storing the configuration file locally, then you need to replace ssm with file in the command and specify the file path, e.g., file:'C:\Program Files\Amazon\AmazonCloudWatchAgent\config.json'

To do this with Run Command:

Navigate to Run Command the same way we did earlier.

In the Command document search bar, choose Documentprefixname, then Equals, and then specify the name of the document AmazonCloudWatch-ManageAgent.

image6

image6

Search for the CloudWatch-Manage Agent command document

Then specify the following command parameters:

  • Action: configure
  • Mode: ec2
  • Optional Configuration Source: ssm
  • Optional Configuration Location: The name of the parameter that stores the CloudWatch agent configuration
  • Optional Open Telemetry Collector Configuration Source: default

The rest of the sections are the same as in the command document we ran earlier.

image7

image7

Configure CloudWatch-ManageAgent Command Parameters

Finally, you can click Run and wait until it configures the CloudWatch agent on the instances you specified.

As of CloudWatch agent version 1.247347.3, there's an embedded AWS OpenTelemetry Collector that enables you to monitor with open telemetry without needing multiple agents. If you need to configure the Open Telemetry Collector, you can change its command parameter to SSM and specify the parameter that stores this configuration in the Optional Open Telemetry Collector Configuration Location field.

Verify Amazon CloudWatch Agent Configuration ^

Once configured, you can verify whether the configurations specified in the configuration file have taken place successfully by doing the following:

  • Logs: Navigate to the CloudWatch console and select Logs > Log groups. Check whether the log groups you specified in the configuration file are there, with streams inside them and logs pushed to these streams.
  • Metrics: Navigate to the CloudWatch console and select Metrics > All Metrics. You should see it under Custom Namespaces. Open this namespace and see if the metrics specified in the configuration file are being pushed.

Conclusion ^

In this article, we've gone through the installation and configuration of the Amazon CloudWatch agent. If you have any further questions, please mention them in the comments.

Subscribe to 4sysops newsletter!

DISCLAIMER: This article represents my own viewpoints, not those of my employer, Amazon Web Services.

+1

avatar
Sours: https://4sysops.com/archives/install-and-configure-amazon-cloudwatch-agent-on-ec2-instances/

Agent windows cloudwatch

Status of CloudWatch Agent – Verify, Start & Stop it

Don’t know how to find the Status of CloudWatch Agent? We can help you.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see how to query CloudWatch Agent to find its status.

 

Status of CloudWatch Agent

Moving ahead, let us discuss different aspects of a CloudWatch Agent.

 

  • Verify that the CloudWatch agent is running

To do so, we use AWS Systems Manager.

In addition, on the local server, we can use the command line.

  1. We open the Systems Manager console.
  2. Then in the navigation pane, we select Run Command.

-or-

If the AWS Systems Manager home page opens, we select Explore Run Command.

  1. In the Command document list, we select the AmazonCloudWatch-ManageAgent.
  2. In the Action list, we select status.
  3. We select the default for Optional Configuration Source.
  4. We keep Optional Configuration Location blank.
  5. Then in the Target area, we select the instance to check.
  6. Finally, we click, Run.

The output will be like this:

On the other hand, to query the status locally via the command line our Support Techs suggest:

On a Linux server:

Then on a Windows Server as an administrator, we run:

 

  • Stop and restart the CloudWatch agent

First, let us stop the agent via Run Command.

  1. To do so, we open the Systems Manager console
  2. In the navigation pane, we select the Run Command.

-or-

Like the above, if the home page opens, we select Explore Run Command.

  1. In the Command document list, we select AmazonCloudWatch-ManageAgent.
  2. Then in the Targets area, we select the instance with the CloudWatch agent.
  3. In the Action list, we select stop.
  4. We keep Optional Configuration Source and Optional Configuration Location blank.
  5. Later we select, Run.

Now, let us stop it locally via the command line.

On a Linux server:

On Windows Server:

 

  • Start the CloudWatch agent using Systems Manager Run Command

Our Support Techs recommend the below steps to start the agent via Run Command:

  1. Open the Systems Manager console.
  2. Then we select the Run Command in the navigation pane.

-or-

In the case of the AWS Systems Manager home page opens, we select Explore Run Command.

  1. In the Command document list, we select AmazonCloudWatch-ManageAgent.
  2. Then we select the instance with the CloudWatch agent in the Targets area.
  3. In the Action list, select configure.
  4. Then in the Optional Configuration Source list, select ssm.
  5. After that, in the Optional Configuration Location box, we enter the name of the agent configuration file that we created and saved.
  6. In the Optional Restart list, we can select yes.
  7. Eventually, we click Run.

 

  • Start the CloudWatch agent on an Amazon EC2 instance using the command line

To do so, our Support Techs recommend the following:

a) Linux and macOS:

If we save the configuration file in the Systems Manager Parameter Store:

b) Linux and macOS:

On the other hand, if we save the configuration file on the local computer:

c) Windows Server:

If we save the agent configuration file in Systems Manager Parameter Store:

d) Windows Server:

Similarly, if we save the agent configuration file on the local computer:

[Need help with the process? We’d be happy to assist]

 

Conclusion

In short, we saw how our Support Techs find the status of CloudWatch Agent.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

Sours: https://bobcares.com/blog/status-of-cloudwatch-agent/
Monitoring Amazon EC2 Windows Instances using Unified CloudWatch Agent

Installing and running the CloudWatch agent on your servers

After you have created the agent configuration file that you want and created an IAM role or IAM user, use the following steps to install and run the agent on your servers, using that configuration. First, attach an IAM role or IAM user to the server that will run the agent. Then, on that server, download the agent package and start it using the agent configuration you created.

Download the CloudWatch agent package using an S3 download link

You need to install the agent on each server where you will run the agent. The CloudWatch agent is available as a package in Amazon Linux 2. If you are using this operating system, you can install the package by entering the following command. You must also make sure that the IAM role attached to the instance has the CloudWatchAgentServerPolicy attached. For more information, see Create IAM roles to use with the CloudWatch agent on Amazon EC2 instances.

On all supported operating systems, you can download and install the CloudWatch agent using the command line with an Amazon S3 download link as described in the following steps.

For each download link, there is a general link as well as links for each Region. For example, for Amazon Linux and Amazon Linux 2 and the x86-64 architecture, three of the valid download links are:

ArchitecturePlatformDownload linkSignature file link

x86-64

Amazon Linux and Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Centos

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/centos/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

Debian

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/debian/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig

x86-64

Oracle

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/oracle_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig

x86-64

macOS

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3..amazonaws.com/amazoncloudwatch-agent-/darwin/amd64/latest/amazon-cloudwatch-agent.pkg

https://s3.amazonaws.com/amazoncloudwatch-agent/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/darwin/amd64/latest/amazon-cloudwatch-agent.pkg.sig

x86-64

Windows

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3..amazonaws.com/amazoncloudwatch-agent-/windows/amd64/latest/amazon-cloudwatch-agent.msi

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig

ARM64

Amazon Linux 2

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Redhat

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig

ARM64

Ubuntu

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb

https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig

ARM64

SUSE

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3..amazonaws.com/amazoncloudwatch-agent-/suse/arm64/latest/amazon-cloudwatch-agent.rpm

https://s3.amazonaws.com/amazoncloudwatch-agent/suse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

https://s3..amazonaws.com/amazoncloudwatch-agent-suse/arm64/latest/amazon-cloudwatch-agent.rpm.sig

To use the command line to install the CloudWatch agent on an Amazon EC2 instance

  1. Download the CloudWatch agent. For a Linux server, enter the following. For , use the appropriate download link from the previous table.

    For a server running Windows Server, download the following file:

  2. After you have downloaded the package, you can optionally verify the package signature. For more information, see Verifying the signature of the CloudWatch agent package.

  3. Install the package. If you downloaded an RPM package on a Linux server, change to the directory containing the package and enter the following:

    If you downloaded a DEB package on a Linux server, change to the directory containing the package and enter the following:

    If you downloaded an MSI package on a server running Windows Server, change to the directory containing the package and enter the following:

    This command also works from within PowerShell. For more information about MSI command options, see Command-Line Options in the Microsoft Windows documentation.

(Installing on an EC2 instance) Attaching an IAM role

To enable the CloudWatch agent to send data from the instance, you must attach an IAM role to the instance. The role to attach is CloudWatchAgentServerRole.

For more information on attaching an IAM role to an instance, see Attaching an IAM Role to an Instance in the Amazon EC2 User Guide for Windows Instances.

(Installing on an on-premises server) Specify IAM credentials and AWS Region

To enable the CloudWatch agent to send data from an on-premises server, you must specify the access key and secret key of the IAM user that you created earlier. For more information about creating this user, see Create IAM roles and users for use with CloudWatch agent.

You also must specify the AWS Region to send the metrics to, using the field in the section of the AWS config file, as in the following example.

The following is an example of using the command to create a named profile for the CloudWatch agent. This example assumes that you are using the default profile name of .

To create the AmazonCloudWatchAgent profile for the CloudWatch agent

  1. If you haven't already done so, install the AWS Command Line Interface on the server. For more information, see Installing the AWS CLI.

  2. On Linux servers, enter the following command and follow the prompts:

    On Windows Server, open PowerShell as an administrator, enter the following command, and follow the prompts.

Verify internet access

Your Amazon EC2 instances must have outbound internet access to send data to CloudWatch or CloudWatch Logs. For more information about how to configure internet access, see Internet Gateways in the Amazon VPC User Guide.

The endpoints and ports to configure on your proxy are as follows:

  • If you're using the agent to collect metrics, you must whitelist the CloudWatch endpoints for the appropriate Regions. These endpoints are listed in Amazon CloudWatch in the Amazon Web Services General Reference.

  • If you're using the agent to collect logs, you must whitelist the CloudWatch Logs endpoints for the appropriate Regions. These endpoints are listed in Amazon CloudWatch Logs in the Amazon Web Services General Reference.

  • If you're using Systems Manager to install the agent or Parameter Store to store your configuration file, you must whitelist the Systems Manager endpoints for the appropriate Regions. These endpoints are listed in AWS Systems Manager in the Amazon Web Services General Reference.

(Optional) Modify the common configuration for proxy or Region information

The CloudWatch agent includes a configuration file called . You can optionally use this file to specify proxy and Region information.

On a server running Linux, this file is in the directory. On a server running Windows Server, this file is in the directory.

The default is as follows.

All lines are commented out initially. To set the credential profile or proxy settings, remove the from that line and specify a value. You can edit this file manually or by using the Run Command in Systems Manager:

  • – For on-premises servers, this line specifies the IAM user credential profile to use to send data to CloudWatch. If you keep this line commented out, is used. For more information about creating this profile, see (Installing on an on-premises server) Specify IAM credentials and AWS Region.

    On an EC2 instance, you can use this line to have the CloudWatch agent send data from this instance to CloudWatch in a different AWS Region. To do so, specify a named profile that includes a field specifying the name of the Region to send to.

    If you specify a , you must also remove the from the beginning of the line.

  • – To have the agent look for credentials in a file located in a path other than the default path, specify that complete path and file name here. The default path is on Linux and is on Windows Server.

    The first example below shows the syntax of a valid line for Linux servers, and the second example is valid for Windows Server. On Windows Server, you must escape the \ characters.

    If you specify a , you must also remove the from the beginning of the line.

  • Proxy settings – If your servers use HTTP or HTTPS proxies to contact AWS services, specify those proxies in the and fields. If there are URLs that should be excluded from proxying, specify them in the field, separated by commas.

Start the CloudWatch agent using the command line

Follow these steps to use the command line to start the CloudWatch agent on a server.

To use the command line to start the CloudWatch agent on a server

  1. Copy the agent configuration file that you want to use to the server where you're going to run the agent. Note the pathname where you copy it to.

  2. In this command, causes the agent to load the latest version of the CloudWatch agent configuration file, and starts the agent.

    Enter one of the following commands. Replace with the path to the agent configuration file. This file is called if you created it with the wizard, and might be called if you created it manually.

    On an EC2 instance running Linux, enter the following command.

    On an on-premises server running Linux, enter the following:

    On an EC2 instance running Windows Server, enter the following from the PowerShell console:

    On an on-premises server running Windows Server, enter the following from the PowerShell console:

Document Conventions

Create IAM roles and users for use with CloudWatch agent

Install the CloudWatch agent using Systems Manager

Sours: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.html

Similar news:

If you lose, the bull will fuck you and then they will execute you. What a stupid joke. But after these words the girl was taken to the basement to the left, and the king went to the right.



2577 2578 2579 2580 2581