No commit activity in last 3 years
No release in over 3 years
Sensu plugins for Victorops alerting service
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
~> 13.0
~> 6.2
~> 3.2
~> 3.4
~> 0.80.1
~> 0.9.20

Runtime

= 2.3.0
 Project Readme

Sensu-Plugins-victorops

Build Status Gem Version Code Climate Test Coverage Dependency Status Sensu Bonsai Asset

Functionality

Files

  • bin/handler-victorops.rb

Usage

bin/handler-victorops.rb --help
Usage: bin/handler-victorops.rb (options)
    -a, --api-url APIURL             VictorOps API URL without routing key. Or use envvar VICTOROPS_API_URL.
        --dryrun                     Report settings, and take no action
        --map-go-event-into-ruby     Enable Sensu Go to Sensu Ruby event mapping. Alternatively set envvar SENSU_MAP_GO_EVENT_INTO_RUBY=1.
    -r, --routingkey KEY             Routing key. Or use envvar VICTOROPS_ROUTING_KEY.

Sensu Go Enabled

Plugin versions 2.0 and higher are now Sensu Go enabled. You can map Sensu Go events into Sensu Classic events by using the flag --map_go_event_into_ruby as part of your command. Now that Sensu Classic is now EOL, a future version of this plugin will drop support for Sensu Classic and will assume Sensu Go event structuring.

Here is an example Sensu Go handler resource definition for reference. Please note, this plugin's Sensu Asset should be used in conjunction with the Sensu Ruby runtime asset.

---
type: Handler
spec:
  metadata:
    name: victorops
    namespace: default
    labels: 
    annotations: 
  type: pipe
  command: handler-victorops.rb --map_go_event_into_ruby
  timeout: 0
  handlers: []
  filters:
  - is_incident
  env_vars:
  - VICTOROPS_API_URL=https://alert.victorops.com/integrations/generic/01234567/alert/0123456789101112
  - VICTOROPS_ROUTING_KEY=testing
  runtime_assets:
  - sensu-plugins-victorops
  - sensu-ruby-runtime

You'll note that the plugin supports environment variables for both routing key and api url. You can define this in the Sensu Go handler resource definition. You can support multiple VictorOps accounts by having a different handler definition, each with appropriate environment variables defined.

Sensu Classic Support

Here is an example handlers configuration for Sensu Classic. Please note, Sensu Classic has now reached EOL, and support for Sensu Classic events is planned to be removed in a future version of this plugin.

{
  "victorops": {
    "api_url": "YOUR_API_URL_WHITOUT_ROUTING_KEY",
    "routing_key": "everyone"
  },
  "handlers": {
    "victorops": {
      "type": "pipe",
      "command": "handler-victorops.rb"
    }
  }
}

If you have multiple VictorOps accounts and need to route alerts to different endpoints, specifying the handler name in the config is necessary otherwise, the handler will attempt to route to the default victorops. You will therefore need to use the -name switch to specify the API endpoint as noted below.

"victorops_enpoint1": {
      "type": "pipe",
      "command": "/opt/sensu/embedded/bin/handler-victorops.rb -name victorops_endpoint1"
    },

Installation

Installation and Setup