sensu-plugins-riemann 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.md +12 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/bin/handler-riemann-metrics.rb +69 -0
- data/lib/sensu-plugins-riemann/version.rb +9 -0
- data/lib/sensu-plugins-riemann.rb +1 -0
- metadata +210 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZWYxNDliOWY2MDliYTdmNDUzOThlNjkxMDg1NjY0YjNiODE4MDY5MA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWNlYzY0NzU3NGMyODk0MGJhNGRmMzVlYTc3ZmQ4MjY0MGNhN2M5OQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NGNmNjhmNDg1ZDIxNjkwOTgwY2ExZDIzMWRmOGNjMmQyNDI3OGE0YzNlNTcy
|
10
|
+
ZWE0NGM0YjU0Y2RmMWFiNzdiMGI5ZjQ4ZWE4NzM3YzAxMzI0MjFhZmQxYjFk
|
11
|
+
YTY0ZDM4NzI5NTAzNTBmMzM2NzlkZmI4ZWYwYjA1M2ExYjRiZTk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjdiOTNkM2FjYjcyMjUzMTA2MmE3ODA2YjQ4OTJkZGQ3Y2U4ZmM4Yzc0OGY0
|
14
|
+
NjlmZjE1NjkxMjBkYTAzMDQ4M2Y4ZDBjOWVlNDczZjc0YjY2MzkyN2Q0ZjQ0
|
15
|
+
OTI1ODhhOGEwODg1YTZjYzA1NDg5ZDdkOTI4MWYwYjc2MTAxY2I=
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#Change Log
|
2
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
|
+
|
4
|
+
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
|
+
|
6
|
+
## [Unreleased]
|
7
|
+
|
8
|
+
## 0.0.1 - 2015-09-03
|
9
|
+
### Added
|
10
|
+
- initial release
|
11
|
+
|
12
|
+
[unreleased]: https://github.com/sensu-plugins/sensu-plugins-riemann/compare/0.0.1...HEAD
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Sensu-Plugins
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
## Sensu-Plugins-riemann
|
2
|
+
|
3
|
+
[ ![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-riemann.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-riemann)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-riemann.svg)](http://badge.fury.io/rb/sensu-plugins-riemann)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riemann/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riemann)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riemann/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-riemann)
|
7
|
+
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-riemann.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-riemann)
|
8
|
+
|
9
|
+
## Functionality
|
10
|
+
|
11
|
+
## Files
|
12
|
+
* bin/handler-riemann-metrics
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
```json
|
17
|
+
{
|
18
|
+
"riemann" : {
|
19
|
+
"riemann_host" : "localhost",
|
20
|
+
"port" : 5555
|
21
|
+
}
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
|
28
|
+
|
29
|
+
## Notes
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
## encoding: UTF-8
|
3
|
+
## riemann
|
4
|
+
##
|
5
|
+
## DESCRIPTION:
|
6
|
+
##
|
7
|
+
# Sends metrics data to a Riemann server.
|
8
|
+
#
|
9
|
+
## OUTPUT:
|
10
|
+
## metric data
|
11
|
+
##
|
12
|
+
## PLATFORMS:
|
13
|
+
## All
|
14
|
+
##
|
15
|
+
## DEPENDENCIES:
|
16
|
+
## gem: sensu-plugin
|
17
|
+
## gem: riemann-client
|
18
|
+
##
|
19
|
+
## LICENSE:
|
20
|
+
## James Turnbull <james@lovedthanlost.net>
|
21
|
+
## Released under the same terms as Sensu (the MIT license); see LICENSE
|
22
|
+
## for details.
|
23
|
+
##
|
24
|
+
|
25
|
+
require 'rubygems' if RUBY_VERSION < '1.9.0'
|
26
|
+
require 'sensu-handler'
|
27
|
+
require 'riemann/client'
|
28
|
+
|
29
|
+
class Riemann < Sensu::Handler
|
30
|
+
# override filters from Sensu::Handler. not appropriate for metric handlers
|
31
|
+
def filter; end
|
32
|
+
|
33
|
+
def event_state
|
34
|
+
case @event['check']['status']
|
35
|
+
when 0
|
36
|
+
'ok'
|
37
|
+
when 1
|
38
|
+
'warning'
|
39
|
+
when 2
|
40
|
+
'critical'
|
41
|
+
else
|
42
|
+
'unknown'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def handle
|
47
|
+
riemann_host = settings['riemann']['riemann_host']
|
48
|
+
riemann_port = settings['riemann']['riemann_port']
|
49
|
+
metrics = @event['check']['output']
|
50
|
+
check_name = @event['check']['name']
|
51
|
+
client_name = @event['client']['name']
|
52
|
+
client = Riemann::Client.new host: riemann_host, port: riemann_port, timeout: 5
|
53
|
+
|
54
|
+
begin
|
55
|
+
metrics.split("\n").each do |output_line|
|
56
|
+
(metric_name, metric_value, epoch_time) = output_line.split("\t")
|
57
|
+
client << {
|
58
|
+
host: client_name,
|
59
|
+
service: check_name,
|
60
|
+
tags: ['sensu'],
|
61
|
+
time: epoch_time,
|
62
|
+
state: event_state,
|
63
|
+
description: metric_name,
|
64
|
+
metric: metric_value
|
65
|
+
}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'sensu-plugins-riemann/version'
|
metadata
ADDED
@@ -0,0 +1,210 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sensu-plugins-riemann
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sensu Plugins and contributors
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sensu-plugin
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: riemann-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.2.6
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: github-markup
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.3'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: redcarpet
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.2'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.2'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.37'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.37'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.1'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ~>
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.1'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: yard
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ~>
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.8'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ~>
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.8'
|
167
|
+
description: This plugin emits metrics from Sensu to Riemann.
|
168
|
+
email: <sensu-users@googlegroups.com>
|
169
|
+
executables:
|
170
|
+
- handler-riemann-metrics.rb
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- CHANGELOG.md
|
175
|
+
- LICENSE
|
176
|
+
- README.md
|
177
|
+
- bin/handler-riemann-metrics.rb
|
178
|
+
- lib/sensu-plugins-riemann.rb
|
179
|
+
- lib/sensu-plugins-riemann/version.rb
|
180
|
+
homepage: https://github.com/sensu-plugins/sensu-plugins-riemann
|
181
|
+
licenses:
|
182
|
+
- MIT
|
183
|
+
metadata:
|
184
|
+
maintainer: ! '@jamtur01'
|
185
|
+
development_status: active
|
186
|
+
production_status: unstable - testing recommended
|
187
|
+
release_draft: 'false'
|
188
|
+
release_prerelease: 'false'
|
189
|
+
post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
|
190
|
+
in /etc/default/sensu
|
191
|
+
rdoc_options: []
|
192
|
+
require_paths:
|
193
|
+
- lib
|
194
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ! '>='
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: 1.9.3
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 2.4.5
|
207
|
+
signing_key:
|
208
|
+
specification_version: 4
|
209
|
+
summary: Sensu plugins for Riemann
|
210
|
+
test_files: []
|