Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Grafana_for_AWS_and_Azure

This is a solution for creating monitoring for AWS and Azure resources (fast and easy).


AWS

CloudFormation template for adding an EC2 instance with a fully automated bootstrap script to create monitoring that automatically connects to AWS CloudWatch and allows easy viewing of key metrics for AWS resources. Technologies used: Docker, CloudFormation

Description

Run EC2 instance with Docker running containers: Grafana, InfluxDB and Telegraf.

This CloudFormation template creates all the resources listed.

  • Grafana (EC2)
  • GrafanaSecurityGroup
  • GrafanaIamProfile
  • GrafanaRole
  • GrafanaPolicy

Screen Shot 2022-10-24 at 12 58 36


Running CloudFormation template

  1. Log in to the AWS account
  2. Open CloudFormation and create a stack with new resources
  3. Load the template and fill in the parameters
  4. Visit EC2 IP address (DNS name) to access the Grafana
    • User: admin
    • Password: admin

Video
aws_cf_monitoring.mp4

Azure

ARM template for adding an VM with a fully automated bootstrap script to create monitoring that automatically connects to Azure monitor (data source) for metrics and allows users easy viewing of key metrics for Azure resources.

Description

Resources creation for monitoring:

  • Resource group
  • Virtual network
  • Network Interface
  • Network security group
  • Virtual machine
  • Public IP address
  • Disk

Grafana previsioned Data sources:

  • Azure Monitor for getting metrics on network resources. Credentials will be with User assigned Managed Identity.
  • InfluxDB data source in combination with Telegraf for getting metrics on service UpTime.

Screen Shot 2022-11-07 at 21 19 27


Running ARM temp from Azure CLI

  1. Edit UserData (bootstrap script)

    Open ARM tempate (azuredeploy.json) and Base64 decode userData for VM. After editing variables for the DNS names form script encode it back to Base64.

    base64decode

  2. Log in to Azure

    az login
  3. Set the right subscription

    az account set --subscription "your subscription id"
  4. Create the Resource group

    az account list-locations
    
    az group create --name "resource-group" --location "your location"
  5. Deploy the ARM template

    az group deployment create --name "name of your deployment" --resource-group "resource-group" --template-file "./azuredeploy.json"
  6. In Azure CLI fill in "Linux OS Password" parameter

  • At least 12 characters
  • A mixture of both uppercase and lowercase letters
  • A mixture of letters and numbers
  1. Go to portal.azure.com and add the role assignment “Monitoring Reader” to the Subscription you want to monitor.

iam_role_assignment

  1. Visit GrafanaVM IP address (DNS name) to access the Grafana

    • User: admin
    • Password: admin

Video
azure_arm_monitoring.mp4

Repository info

⚠️ This is a Valcon private repository and it needs a personal access token to be cloned. ⚠️

The maintainer for the repository: senad.dizdarevic@valcon.com If you are cloning this repository and creating a new one make sure to change the git clone command in the user-data section of the template.

About

Monitoring with Grafana for AWS and Azure

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages