Skip to content

luisdalves/sensu-plugins-opsgenie

 
 

Repository files navigation

Sensu-Plugins-opsgenie

Build Status Gem Version Code Climate Test Coverage Dependency Status

Functionality

Files

  • bin/handler-opsgenie.rb
  • bin/check-opsgenie-heartbeat.rb

Usage

handler-opsgenie

{
  "opsgenie": {
    "customerKey": "the-key",
    "teams": ["teams"],
    "recipients": "the-recipients",
    "source": "alert-source",
    "overwrite_quiet_hours": true,
    "tags": ["sensu"]
  }
}

Installation

Installation and Setup

Configuration

To get this to work you need to specify a few different things. For a list of fields that are required/available look at the sensu documentation. These files need to be on the server and the client boxes. Once there restart sensu-server and sensu-api.

  • declare this as a handler: /etc/sensu/conf.d/handler_opsgenie.json
{
  "handlers": {
    "opsgenie": {
      "type": "pipe",
      "command": "/opt/sensu/embedded/bin/handler-opsgenie.rb"
    }
  },
  "opsgenie": {
    "customerKey": "YOUR-KEY-HERE"
  }
}  
  • add it to the check: /etc/sensu/conf.d/check_xxx.json
{
  "checks": {
    "check_elastinats_is_running": {
      "command": "/opt/sensu/embedded/bin/check-process.rb -p cron",
      "interval": 60,
      "handlers": [ "opsgenie" ],
      "subscribers": [ "core" ]
    }
  }
}
  • optionally add it to the default handler: /etc/sensu/conf.d/default_handler.json
{
  "handlers": {
    "default": {
      "type": "set",
      "handlers": [
        "opsgenie"
      ]
    }
  }
}

Notes

Packages

No packages published

Languages

  • Ruby 100.0%