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 software it’s supposed to be monitoring!
AWS’s solution to this problem isCloudWatch.
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.
The agent is what sends information back to AWS that your server generates.
There is no recovering keys once they are lost, and not even Amazon can recover them for you.
If you did everything correctly, you should see a familiar sight: The Windows server desktop.
To do so, Amazon provides you with a prebuilt .msi installer to use.
Either will work for this tutorial.
Start by opening a PowerShell window on your EC2 instance and entering the commands below.
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 theGet-Servicecmdlet in the screenshot below.
It would be very computationally expensive to send everything back all the time and make a lot of noise.
Amazon uses aJSON configuration fileto direct the agent on which logs and metrics to collect.
To start the wizard, you’ll need to run it from the CloudWatch install directory.
This command will take the config file generated by the wizard and start the service with those configs.
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.