Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

If you are a professional associated with system and infrastructure management, looking at automated infrastructure and deployments, then this book is for you. No prior experience of Salt is required.
Table of Contents (13 chapters)
12
Index

Configuring CloudWatch alarms

Once cloud resources are configured, the next step is to configure monitoring and alerts for them to be aware of important notifications about issues and problems in the ever-growing infrastructure. Amazon provides CloudWatch for this type of requirement. In this recipe, we will learn about how to configure CloudWatch alarms for AWS resources.

How to do it...

  1. Create and edit /opt/ salt-cookbook/production/aws/cloudwatch.sls to have the following entries:
    salt-cookbook-alarm:
      boto_cloudwatch_alarm.present:
        - name: 'salt-cookbook UnHealthyHostCount'
        - attributes:
            metric: UnHealthyHostCount
            namespace: AWS/ELB
            statistic: Average
            comparison: '>='
            threshold: 1.0
            period: 300
            evaluation_periods: 4
            unit: null
            description: salt-cookbook UnHealthyHostCount
            dimensions:
              LoadBalancerName: [salt-cookbook]
            alarm_actions: ['arn:aws:sns:us-west...