All Projects → sensu-plugins → sensu-plugins-mailer

sensu-plugins / sensu-plugins-mailer

Licence: MIT license
This plugin is an email handler for Sensu.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to sensu-plugins-mailer

sensu-plugins-aws
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.
Stars: ✭ 79 (+364.71%)
Mutual labels:  sensu-handler, sensu-plugins
sensu-plugins-sensu
This plugin provides monitoring and metrics for Sensu.
Stars: ✭ 13 (-23.53%)
Mutual labels:  sensu-handler, sensu-plugins
wptelegram
Integrate your WordPress site perfectly with Telegram with full control.
Stars: ✭ 31 (+82.35%)
Mutual labels:  email-notification
sensu-plugins-ssl
This plugin provides native SSL instrumentation for monitoring, including: hostname and chain verification, cert expiry, and Qualys SSL Labs reporting
Stars: ✭ 16 (-5.88%)
Mutual labels:  sensu-plugins
django-email-gateway
A django package which act as a gateway to send and receive email with amazon SES.
Stars: ✭ 25 (+47.06%)
Mutual labels:  email-notification
52-Weeks-of-Pi
Inspired by Shekhar Gulati's "52 technologies in 2016", I've decided to set a goal of 52 Pi ideas over the next year.
Stars: ✭ 54 (+217.65%)
Mutual labels:  email-notification
covaccine-notifier
CoWIN Vaccine availability notifier for India
Stars: ✭ 63 (+270.59%)
Mutual labels:  email-notification
sensu-alerta-handler
Use Alerta as a dashboard for Sensu
Stars: ✭ 21 (+23.53%)
Mutual labels:  sensu-handler
sensu-plugins-mysql
This plugin provides native MySQL instrumentation for monitoring and metrics collection, including: service health, database connectivity, `InnoDB` locks, replication status, metrics collection, and sending metrics to a MySQL database.
Stars: ✭ 20 (+17.65%)
Mutual labels:  sensu-plugins
sensu-plugins-http
This plugin provides native HTTP instrumentation for monitoring and metrics collection, including: response code, JSON response, HTTP last modified, SSL expiry, and metrics via `curl`.
Stars: ✭ 31 (+82.35%)
Mutual labels:  sensu-plugins
sensu-plugins-memory-checks
This plugin provides native memory instrumentation for monitoring and metrics collection, including: memory usage via `free` and `vmstat`, including metrics. Note that this plugin may have cross-platform issues.
Stars: ✭ 15 (-11.76%)
Mutual labels:  sensu-plugins
sensu-plugins-disk-checks
This plugin provides native disk instrumentation for monitoring and metrics collection, including: health, usage, and various metrics.
Stars: ✭ 27 (+58.82%)
Mutual labels:  sensu-plugins

Sensu-Plugins-mailer

Build Status Gem Version Code Climate Test Coverage Dependency Status

Functionality

Files

  • bin/handler-mailer-mailgun.rb
  • bin/handler-mailer-ses.rb
  • bin/handler-mailer.rb

Usage

The following three configuration variables must be set if you want mailer to use remote SMTP settings:

smtp_address - defaults to "localhost"
smtp_port - defaults to "25"
smtp_domain - defaults to "localhost.localdomain"

There is an optional subscriptions hash which can be added to your mailer.json file. This subscriptions hash allows you to define individual mail_to addresses for a given subscription. When the mailer handler runs it will check the clients subscriptions and build a mail_to string with the default mailer.mail_to address as well as any subscriptions the client subscribes to where a mail_to address is found. There can be N number of hashes inside of subscriptions but the key for a given hash inside of subscriptions must match a subscription name.

Optionally, you can specify your own ERB template file to use for the message body. The order of precedence for templates is: command-line argument (-t), client config called "template", the mailer handler config, default.

Optionally, you can specify your own ERB template file to use for the message subject. The order of precedence for templates is: command-line argument (-T), client config called "subject_template", the mailer handler config, default.

{
  "mailer": {
    "mail_from": "[email protected]",
    "mail_to": "[email protected]",
    "smtp_address": "smtp.example.org",
    "smtp_port": "25",
    "smtp_domain": "example.org",
    "template": "/optional/path/to/template.erb",
    "subject_template": "/optional/path/to/subject_template.erb",
    "subscriptions": {
      "subscription_name": {
        "mail_to": "[email protected]"
      }
    }
  }
}

handler-mailer-mailgun

{
  "mailer-mailgun": {
    "mail_from": "[email protected]",
    "mail_to": "[email protected]",
    "mg_apikey": "mailgunapikeygoeshere",
    "mg_domain": "mailgun.domain.com"
  }
}

handler-mailer-ses

{
  "mailer-ses": {
    "mail_from": "[email protected]",
    "mail_to": "[email protected]",
    "aws_access_key": "myawsaccesskey",
    "aws_secret_key": "myawssecretkey",
    "aws_ses_endpoint": "email.us-east-1.amazonaws.com"
  }
}

handler-mailer

{
  "mailer": {
    "admin_gui": "http://admin.example.com:8080/",
    "mail_from": "[email protected]",
    "mail_to": "[email protected]",
    "smtp_address": "smtp.example.org",
    "smtp_port": "25",
    "smtp_domain": "example.org"
  }
}

By default, the handler will use plain as the SMTP authentication type, but you may also specify "smtp_authentication": "ntlm" for compatible servers, e.g. Microsoft Exchange.

Contact Based Routing

Optionally, this handler can use the same syntax as Sensu Enterprise contact routing for sending e-mails for particular checks or clients, in addition to the previous configuration. This is configured by declaring contacts:

support.json

{
  "contacts": {
    "support": {
      "email": {
        "to": "[email protected]"
      }
    }
  }
} 

Then, in a check definition, you can specify a contact or an array of contacts which should be notified by e-mail:

example_check.json

{
  "checks": {
    "example_check": {
      "command": "do_something.rb",
      "handler": "mailer",
      "contact": "support"
    }
  }
}

Additionally, a client definition can specify a contact or an array of contacts to be notified of any check which alerts to the mailer handler. This is configured by specifying a contact value, or contacts array in the client.json configuration.

Installation

Installation and Setup

Create a handler file in /etc/sensu/conf.d with the following content, replacing with your own configuration:

{
    "mailer" :  {
        "admin_gui" : "http://localhost:3000",
        "mail_from": "[email protected]",
        "mail_to": "[email protected]",
        "delivery_method": "smtp",
        "smtp_address": "localhost",
        "smtp_port": "25",
        "smtp_domain": "localhost.local_domain",
        "smtp_enable_starttls_auto": "true",
        "smtp_username" : "username",
        "smtp_password" : "XXXXXXXX"
    },
    "handlers": {
        "mailer": {
            "type": "pipe",
            "command": "/opt/sensu/embedded/bin/handler-mailer.rb"
        }
    }
}

Notes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].