Objective: To establish a robust monitoring and alerting system for a cloud environment using AWS and Datadog. The system is designed to provide real-time insights into server performance, ensuring proactive identification and resolution of potential issues.

Technologies Used:

Cloud Provider: Amazon Web Services (AWS)

Operating System: Ubuntu 20.04 (or the version you used)

Monitoring Platform: Datadog

Communication Channels: Email, Slack, WhatsApp

  1. System Architecture This section describes the overall setup of the project.

Diagram:

Component Breakdown:

AWS EC2 Instance: An Ubuntu server was launched on AWS to serve as the monitored environment. This instance represents a typical production server.

Datadog Agent: The Datadog Agent was installed on the EC2 instance to collect metrics, logs, and traces.

Datadog Platform: This serves as the central hub for data visualization, analysis, and alert management.

Notification Channels: Integrations were configured to route alerts to multiple communication platforms.

  1. Implementation Steps This section details the specific actions taken during the project.

3.1 Server Provisioning and Hardening

  1. AWS EC2 Instance Setup:

Launched an AWS EC2 instance using the Ubuntu AMI.

Configured security groups to allow SSH access.

  1. Server Preparation:

Logged into the server using SSH using Mobaxterm terminal emulator.

Performed system updates and cleaning:

sudo apt update

sudo apt upgrade -y

sudo apt autoremove -y

Hardening: Changed the default SSH port from 22 to a non-standard port (e.g., 2222) to enhance security. This was done by editing the /etc/ssh/sshd_config file and restarting the SSH service.

image.png

3.2 Datadog Integration

  1. Datadog Account Setup:

Created a Datadog account.

Obtained the API key and application key required for agent installation.

  1. Datadog Agent Installation:

Installed the Datadog Agent on the Ubuntu server using the provided one-line installation script.

Configured the agent to collect process and network metrics by editing the datadog.yaml file.

image.png

image.png

3.3 Alerting and Notifications This section focuses on how you set up your alerts.

image.png

  1. Creating Monitors:

CPU Utilization Monitor: Created a monitor to trigger an alert when CPU usage exceeds 80% for more than 5 minutes. This helps to identify performance bottlenecks.

System Process Monitor: Set up a monitor to alert if a critical process stops running.

Network Inbound Monitor: Configured a monitor to alert on unusual spikes in network traffic.

  1. Notification Channel Configuration:

Email: Integrated email notifications by adding an email address to the monitor's notification list.

Slack: Configured the Slack integration in Datadog and linked a specific Slack channel to receive alerts.

WhatsApp: Used a third-party service (like Twilio, Vonage, etc., if you used one) or a custom webhook to forward alerts from Datadog to a WhatsApp number. This involved creating a webhook URL in Datadog and a script to format and send the message.

  1. Conclusion and Learnings This section reflects on what you accomplished and learned.

Summary of Accomplishments:

Successfully provisioned and secured a cloud server.

Implemented comprehensive monitoring using the Datadog Agent.

Configured a multi-channel alerting system to ensure timely notifications.

Key Learnings:

Understood the importance of proactive monitoring in a production environment.

Gained practical experience with AWS, Datadog, and Linux system administration.

Learned how to integrate various services (email, Slack, etc.) to build a cohesive alerting workflow.

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png