Setup AWS Logs Agent On Ubuntu 16.04 Instance

This tutorial will guide you through the steps for configuring awslogs agent on an EC2 Ubuntu 16.04 server instance.

Install And Configure AWSLogs

Step1: Update the system and install python.

Step2: Download the latest agent installation script.

Step3: Run the agent setup command with the region parameter. Replace the eu-west-2with the aws region code where you are operating.

Fill in the required parameters when prompted.

Setup AWSLogs As A Service

There is no support for creating awslogs as a service in Ubuntu 16.04. So we need to create our own systemd unit file for running it as a service.

1. cd into /etc/systemd/system directory.

2. Create a file named awslogs.service

3. Copy the following content on the awslogs.service file.

4. Now start the agent using the following command.

READ  How to Migrate WordPress Site to Digital Ocean Cloud Server

To stop and restart, you can use the following commands.

5. To enable awslogs service on boot, execute the following command.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s