Repository is archived
No commit activity in last 3 years
No release in over 3 years
This plugin provides native AWS instrumentation for monitoring and metrics collection, including: health and metrics for various AWS services, such as EC2, RDS, ELB, and more, as well as handlers for EC2, SES, and SNS.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
~> 0.10
~> 12.3
~> 3.2
~> 3.4
~> 0.51.0
~> 0.9.11

Runtime

~> 3.0
= 2.7.0
= 1.32.0
= 1.43.0
>= 1.10.4, < 2.0
= 3.1.0
 Project Readme

Sensu-Plugins-aws

Gem Version Sensu Bonsai Asset

This is an unofficial fork

Due to the lack of activity from owners of sensu-plugins-aws I have created this fork. It is automatically tested, built and published to RubyGems and Bonsai. It includes several new plugins as well as some improvements. Please check the changelog at the GitHub Releases page.

Sensu Asset

The Sensu assets packaged from this repository are built against the Sensu Ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu Ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found here in the Bonsai Asset Index.

Usage

handler-ses

  1. Configure authentication
  2. Enable the handler in /etc/sensu/conf.d/handlers/ses.json:
{
  "handlers": {
    "ses": {
      "type": "pipe",
      "command": "handler-ses.rb"
    }
  }
}
  1. Configure the handler in /etc/sensu/conf.d/ses.json:
{
  "ses": {
    "mail_from": "sensu@example.com",
    "mail_to": "monitor@example.com",
    "region": "us-east-1",
    "subscriptions": {
      "subscription_name": {
        "mail_to": "teamemail@example.com"
      }
    }
  }
}

handler-sns

handler-sns can be used to send alerts to Email, HTTP endpoints, SMS, or any other subscription type supported by SNS.

  1. Create an SNS topic and subscription [Docs]
  2. Configure authentication
  3. Enable the handler in /etc/sensu/conf.d/handlers/sns.json:
{
  "handlers": {
    "sns": {
      "type": "pipe",
      "command": "handler-sns.rb"
    }
  }
}
  1. Configure the handler in /etc/sensu/conf.d/sns.json:
{
  "sns": {
    "topic_arn": "arn:aws:sns:us-east-1:111111111111:topic",
    "region": "us-east-1"
  }
}

Installation

Installation and Setup

Note: In addition to the standard installation requirements the installation of this gem will require compiling the nokogiri gem. Due to this you'll need certain development packages on your system.

On Ubuntu systems run the following to install build dependencies:

sudo apt-get install build-essential libxml2-dev zlib1g-dev

On CentOS systems, run the following to install build dependencies:

sudo yum groupinstall -y "Development Tools"
sudo yum install -y libxml2-devel zlib-devel

If you'd like to avoid compiling nokogiri and other gems on every system where you need to install this plugin collection, please have a look at the Sensu guide for pre-compiling plugin packages.

Authentication

AWS credentials are required to execute these checks. Starting with AWS-SDK v2 there are a few methods of passing credentials to the check:

  1. Use a credential file. Place the credentials in ~/.aws/credentials. On Unix-like systems this is going to be /opt/sensu/.aws/credentials. Be sure to restrict the file to the sensu user.
[default]
aws_access_key_id = <access_key>
aws_secret_access_key = <secret_access_key>
  1. Use an EC2 instance profile. If the checks are executing on an EC2 instance you can give the instance an IAM role and authentication will be handled automatically.

See the AWS-SDK docs for more details on credential configuration.

Some of the checks accept credentials with aws_access_key and aws_secret_access_key options however this method is deprecated as it is insecure to pass credentials on the command line. Support for these options will be removed in future releases.

No matter which authentication method is used you should restrict AWS API access to the minimum required to run the checks. In general this is done by limiting the sensu IAM user/role to the necessary Describe calls for the services being checked.