Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Amazon AWS® CloudWatch is a service of Amazon Web Services that monitors the customer's applications and resources running on the AWS® infrastructure in real - time. It is used to track and to collect metrics, variables you can measure for your applications and resources. AWS® CloudWatch monitors resources like Amazon Elastic Compute Cloud (EC2®) instances, Elastic Load Balancing (ELB®), Amazon Elastic Block Store (EBS®) volumes, and Amazon Relational Database Service (RDS®) instances.

JS7 can be integrated with AWS® CloudWatch. This integration allows users to check the logs and current statistics in a graphical user interface.

For JS7 JobScheduler as a Service, find the following suggested architecture.

...

.

Advantages of CloudWatch Logs

  • CloudWatch Logs provides real-time application and System Monitoring.
  • Long-term log retention.
  • A view of the entire infrastructure.
  • CloudWatch can be used to set alarms and to execute automatic actions.
  • Users can tune their AWS services to deliver the highest performance and throughput using the metric data and logs.

User Benefits of CloudWatch Logs

  • Easy to set up Alarms and Rules - In CloudWatch, users can set up Alarms to receive notifications while triggering the error messages from log files.
  • Users can access all the data from a single dashboard. Lots of data can be accessed through a single CloudWatch Interface.
  • CloudWatch Logs enables users to see all the logs as a single and consistent flow of events ordered by time. Users can query and sort them based on their dimensions, create custom computations with a powerful query language, group them by specific fields, and visualize log data in dashboards. 

Setting up CloudWatch

Managing the IAM Role

Creating the IAM Role

...

  • Login to AWS® Management Console and open the IAM console. Select Roles from the menu and then click the Create role button.



  • Select the service that will use this Role for the AWS® services (EC2, Lambda, and others). Select EC2 and click the Next: Permission button.



  • To select your new role's policy , search for the CloudWatchAgentServerPolicy, check the checkbox and click the Next button. 



  • Provide the Role Name, review, and create the Role.


Attaching the IAM Role

...

Installing the CloudWatch Agent

Run Users can run the following commands to connect to the EC2 instance. First, the CloudWatch Agent has to be installed from S3. The below command can be used, for example to download for AMD64 Ubuntu.

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


Use the The below command can be used to download the CloudWatch Agent for Windows.

Code Block
Invoke-WebRequest -Uri "https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi" -OutFile "C:\amazon-cloudwatch-agent.msi" 

...

To install the CloudWatch Agent on Windows, the below MSI installer file is executed:

...

The CloudWatch Agent makes use of a configuration file that, by default, is looked up from the below path:
If this file is unavailable from the below path, the user must create it manually.

Code Block
/opt/aws/amazon-cloudwatch-agent/bin/config.json


From the above path, users can create the configuration file with the following content:

...

The wizard automatically creates the config.json file having asked a number of questions related to collecting system-level metrics. When using the wizard, users can always use the generated configuration file and manually add it to any EC2 instances.


Starting the CloudWatch Agent

Run Users can run the below command to execute the CloudWatch Agent on Ubuntu Server:

Code Block
$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s


Run Users can run the below command to execute the CloudWatch Agent on Windows:

...

In the CloudWatch Overview, users can select Logs from the menu. Users find the label for the Log Group created in the configuration of Logs. Selecting the Log Group Name allows to see the Log Streams. Clicking the Log Stream specifies the EC2 instance from which data is logged.

CloudWatch Logs provides good search capabilities. Users can use the filter text box to search in logs. Also, it can create alerts or notify users when triggering error messages or warnings from log files.