sensu-plugins-telegram 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fb3167d020cbafe3bf7936203b4641c70cb2b6f
4
- data.tar.gz: 023d3cb5d190a3c81d989653e963a1bdb106b6a5
2
+ SHA256:
3
+ metadata.gz: 63a0b0a56172de8e488f318d430c213ebac2b85c279e3fed6f46cc34892fa9f5
4
+ data.tar.gz: f49dc0aa509ca8f847f4a455cf6883a95fb0c6c9aa6ac0673f730f53943d665b
5
5
  SHA512:
6
- metadata.gz: 964f16a0d6ba57adaf84ecc82dc1c8ed9e6454411f6c6da5a3b6f17926809a738083bcfc8d630068d3608d45879024840f72eecc3d8c040e5bf938d62eb83d9a
7
- data.tar.gz: 0074038bb4011035d5bc9105a14b7ef08bdac5764f0f18f5ce7160210d3f0cbbd22a3b43268f14791de90d03fda9cadfef13961d811feb45234280250fe9e549
6
+ metadata.gz: c31f63545eafefc899df5d8c462b29b2d2516a0b200a66d2cf57e866d0cea95bcb1b7e7b7084da764d0cdbd397e6076dd8343218a8d781abc6d1faf7b5e09cf1
7
+ data.tar.gz: 77e9b486a60cf5bb937e052d82f3932ab2f192e16b242a1ddb46063af37e6e315b472eae4114bf1faa77fe17ab4de917b342c2a176e7a905ff7a0db14f32cdc2
@@ -1,16 +1,31 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows [this format](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ## [1.0.1] - 2017-07-29
8
+ ## [3.0.0] - 2018-11-24
9
+ ### Breaking Changes
10
+ - Remove support for Ruby < 2.3 per the Sensu Plugins [policy](https://github.com/sensu/sensu-docs/blob/master/content/plugins/1.0/faq.md#what-is-the-policy-on-supporting-end-of-lifeeol-ruby-versions).
11
+ - Update sensu-plugins to `~> 2.7`. Many breaking changes, see:
12
+ - [1.4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v140---2016-07-20)
13
+ - [2.0.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29)
14
+
15
+ ### Security
16
+ - Updated Rubocop to `~> 0.60.0`, which fixes [CVE-2017-8418](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418).
17
+ - Updated Yard to `~> 0.9.11`, which fixes [CVE-2017-17042](https://nvd.nist.gov/vuln/detail/CVE-2017-17042).
18
+
19
+ ### Changed
20
+ - Relaxed the rest-client version, since it doesn't need to be so specific, and `gem build` was showing a warning.
21
+ - Fixed cop violations
22
+
23
+ ## [2.0.1] - 2017-07-29
9
24
  ### Fixed
10
25
  - use rest-client 2 to fix issue with OpenSSL 1.1.0 (@ushis)
11
26
 
12
27
  ## [2.0.0] - 2017-05-30
13
- ### Breaking Change
28
+ ### Breaking Changes
14
29
  - removed ruby 1.9x support
15
30
 
16
31
  ### Changed
@@ -28,9 +43,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
28
43
  ## [0.2.0] - 2016-03-23
29
44
  ### Added
30
45
  - Emojis!
31
- - The json_config command line option, which lets you specify custom configs
46
+ - The `json_config` command line option, which lets you specify custom configs
32
47
  for different handlers.
33
- - the bot_token and error_file_location settings can also be specified
48
+ - the `bot_token` and `error_file_location` settings can also be specified
34
49
  directly in the event data.
35
50
 
36
51
  ### Fixed
@@ -45,7 +60,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
45
60
  ### Added
46
61
  - Initial release
47
62
 
48
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/2.0.1...HEAD
63
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/3.0.0...HEAD
64
+ [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/2.0.1...3.0.0
49
65
  [2.0.1]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/2.0.0...2.0.1
50
66
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/1.0.1...2.0.0
51
67
  [1.0.1]: https://github.com/sensu-plugins/sensu-plugins-telegram/compare/1.0.0...1.0.1
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-telegram.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-telegram)
4
4
  [![Gem Version](https://badge.fury.io/rb/sensu-plugins-telegram.svg)](http://badge.fury.io/rb/sensu-plugins-telegram)
5
- [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-telegram.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-telegram)
6
5
 
7
6
  ## Functionality
8
7
 
@@ -20,7 +19,8 @@ After installation, you have to set up a `pipe` type handler, like so:
20
19
  "handlers": {
21
20
  "telegram": {
22
21
  "type": "pipe",
23
- "command": "handler-telegram.rb"
22
+ "command": "handler-telegram.rb",
23
+ "filter": "occurrences"
24
24
  }
25
25
  }
26
26
  }
@@ -43,8 +43,9 @@ This gem also expects a JSON configuration file with the following contents:
43
43
  [@BotFather](https://telegram.me/botfather).
44
44
  - `chat_id`: the chat to which the error message is to be sent.
45
45
  The bot must be a member of this channel or group.
46
- You can get this chat_id by adding the bot to the corresponding group
47
- and then accessing `https://api.telegram.org/bot<TOKEN>/getUpdates`.
46
+ You can get the `chat_id` by adding the bot to the corresponding group,
47
+ sending a message like `/fakecmd @your-bot-username`, and then accessing
48
+ `https://api.telegram.org/bot<TOKEN>/getUpdates`.
48
49
  - `error_file_location` (optional): in case there is a failure sending the
49
50
  message to Telegram (ie. connectivity issues), the exception mesage will
50
51
  be written to a file in this location. You can then monitor this
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # handler-telegram
4
6
  #
@@ -35,7 +37,6 @@
35
37
  # Released under the same terms as Sensu (the MIT license); see LICENSE
36
38
  # for details.
37
39
 
38
- require 'rubygems' if RUBY_VERSION < '1.9.0'
39
40
  require 'sensu-handler'
40
41
  require 'restclient'
41
42
  require 'cgi'
@@ -144,11 +145,13 @@ class TelegramHandler < Sensu::Handler
144
145
  end
145
146
 
146
147
  def handle_error(exception)
147
- open(error_file, 'w') do |f|
148
+ return unless error_file
149
+
150
+ File.open(error_file, 'w') do |f|
148
151
  f.puts 'URL: ' + telegram_url
149
152
  f.puts 'Params: ' + params.inspect
150
153
  f.puts 'Exception: ' + exception.inspect
151
- end if error_file
154
+ end
152
155
  end
153
156
 
154
157
  def clear_error
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sensu-plugins-telegram/version'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SensuPluginsTelegram
2
4
  module Version
3
- MAJOR = 2
5
+ MAJOR = 3
4
6
  MINOR = 0
5
- PATCH = 1
7
+ PATCH = 0
6
8
 
7
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-telegram
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernan Schmidt
@@ -9,36 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-29 00:00:00.000000000 Z
12
+ date: 2018-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: sensu-plugin
15
+ name: rest-client
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.1'
20
+ version: '2.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.1'
27
+ version: '2.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: rest-client
29
+ name: sensu-plugin
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 2.0.2
34
+ version: '2.7'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 2.0.2
41
+ version: '2.7'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -124,48 +124,48 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '3.2'
126
126
  - !ruby/object:Gem::Dependency
127
- name: rubocop
127
+ name: rspec
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 0.40.0
132
+ version: '3.4'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 0.40.0
139
+ version: '3.4'
140
140
  - !ruby/object:Gem::Dependency
141
- name: rspec
141
+ name: rubocop
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '3.4'
146
+ version: 0.51.0
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '3.4'
153
+ version: 0.51.0
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: yard
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '0.8'
160
+ version: 0.9.11
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: '0.8'
168
- description: Sensu plugins for interfacing with Telegram messenger
167
+ version: 0.9.11
168
+ description: Sensu plugin for interfacing with Telegram messenger
169
169
  email:
170
170
  - hschmidt@suse.de
171
171
  - sensu-users@googlegroups.com
@@ -198,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: 2.0.0
201
+ version: 2.3.0
202
202
  required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.4.5
209
+ rubygems_version: 2.7.8
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Sensu plugins for interfacing with Telegram messenger