sensu-extensions-snmp-trap 0.0.33 → 0.1.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
2
  SHA1:
3
- metadata.gz: c4342e74ab5be7cb98d42caa3c2e352db94b9d54
4
- data.tar.gz: d7992dee469ed47b372d0244db058e00b4721066
3
+ metadata.gz: 2b625c0a0a8ca9fb8e40d8f3045e8dc6293d027a
4
+ data.tar.gz: d34efe3a89b2266681059f94aacd4674bf01150d
5
5
  SHA512:
6
- metadata.gz: 77aa4ebe890f716b1dce69097e5e7a74b42fb681a0237927292c3ad633dc5bcd8c06372ef5905bdc318fdb613c2e259a734ce506576fdc5d67e10da805edd02d
7
- data.tar.gz: 7c1deb9d986c2c356a57ca23170483f453be8a65074a6923bfd6f15ac938f2daba6dece3fa5addfd5e3a205a00725b1df484df7bdfafa419e19846e754a111e0
6
+ metadata.gz: 56f8f6ee139240e5177390e195ff321f5213b7e69c3470077b1fe68f5455c468e2599a70cee7b442b9b498fbc2c548b8282f2fbab0a2c849881f541a5aa60616
7
+ data.tar.gz: fd8b453bdf7eefcb47d32b03054a5f6b18caf40ee0856c40ffb4d0b022b7967f1f8e534403fb023472605e10ce0e0038b8afd6d3ba82980968d3c73f1ddf1aed
data/CHANGELOG.md CHANGED
@@ -2,29 +2,49 @@
2
2
 
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/).
5
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ### Fixed
10
-
11
- ### Added
12
-
13
- ### Changed
14
-
15
- ## [1.0.0] - 2016-01-31
16
-
17
- ### Fixed
18
-
9
+ ## [0.1.0] - 2018-04-06
19
10
  ### Added
11
+ - allow configuration of client sockets (@dudefellah)
20
12
 
13
+ ## [0.0.33] - 2017-01-19
21
14
  ### Changed
22
-
23
- ## 0.0.1 - 2016-01-31
24
-
25
- ### Added
26
-
27
- - Initial release.
28
-
29
- [Unreleased]: https://github.com/sensu-extensions/sensu-extensions-template/compare/v1.0.0...HEAD
30
- [1.0.0]: https://github.com/sensu-extensions/sensu-extensions-template/compare/v0.0.1...v1.0.0
15
+ - simplified map config (@portertech)
16
+
17
+ [Unreleased]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/0.1.0...HEAD
18
+ [0.1.0]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.33...0.1.0
19
+ [0.0.33]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.32...v0.0.33
20
+ [0.0.32]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.31...v0.0.32
21
+ [0.0.31]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.30...v0.0.31
22
+ [0.0.30]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.29...v0.0.30
23
+ [0.0.29]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.28...v0.0.29
24
+ [0.0.28]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.27...v0.0.28
25
+ [0.0.27]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.26...v0.0.27
26
+ [0.0.26]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.25...v0.0.26
27
+ [0.0.25]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.24...v0.0.25
28
+ [0.0.24]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.23...v0.0.24
29
+ [0.0.23]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.22...v0.0.23
30
+ [0.0.22]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.21...v0.0.22
31
+ [0.0.21]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.20...v0.0.21
32
+ [0.0.20]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.19...v0.0.20
33
+ [0.0.19]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.18...v0.0.19
34
+ [0.0.18]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.17...v0.0.18
35
+ [0.0.17]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.16...v0.0.17
36
+ [0.0.16]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.15...v0.0.16
37
+ [0.0.15]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.14...v0.0.15
38
+ [0.0.14]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.13...v0.0.14
39
+ [0.0.13]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.12...v0.0.13
40
+ [0.0.12]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.11...v0.0.12
41
+ [0.0.11]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.10...v0.0.11
42
+ [0.0.10]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.9...v0.0.10
43
+ [0.0.9]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.8...v0.0.9
44
+ [0.0.8]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.7...v0.0.8
45
+ [0.0.7]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.6...v0.0.7
46
+ [0.0.6]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.5...v0.0.6
47
+ [0.0.5]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.4...v0.0.5
48
+ [0.0.4]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.3...v0.0.4
49
+ [0.0.3]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.2...v0.0.3
50
+ [0.0.2]: https://github.com/sensu-plugins/sensu-extensions-snmp-trap/compare/v0.0.1...v0.0.2
data/README.md CHANGED
@@ -53,7 +53,9 @@ Edit `/etc/sensu/conf.d/snmp_trap.json` to change its configuration.
53
53
  },
54
54
  "result_status_map": [
55
55
  ["authenticationFailure", 0]
56
- ]
56
+ ],
57
+ "client_socket_bind": "192.168.0.3",
58
+ "client_socket_port": 1234
57
59
  }
58
60
  }
59
61
  ```
@@ -68,4 +70,52 @@ Edit `/etc/sensu/conf.d/snmp_trap.json` to change its configuration.
68
70
  |handlers|array|["default"]|Handlers to specify in Sensu check results|
69
71
  |result_attributes|hash|{}|Custom check result attributes to add to every SNMP trap Sensu check result|
70
72
  |result_map|array|[]|SNMP trap varbind to Sensu check result translation mappings|
71
- |result_status_map|array|[]|SNMP trap OID to Sensu check result status mappings|
73
+ |result_status_map|array|[]|SNMP trap varbind to Sensu check result status mappings|
74
+ |client_socket_bind|string|"127.0.0.1"|IP to send events to when handled|
75
+ |client_socket_port|integer|3030|Port to send events to when handled|
76
+
77
+ ### Result Map Examples
78
+
79
+ The configurable result map allows you to define SNMP trap varbind to
80
+ Sensu check result attribute mappings. A mapping is comprised of a
81
+ varbind name regular expression and a check attribute. For example, if
82
+ you expect SNMP traps with a varbind name that contains
83
+ "AlertDescription" and you would like to use its value as the Sensu
84
+ check result output:
85
+
86
+ ``` json
87
+ {
88
+ "snmp_trap": {
89
+ "...": "...",
90
+ "result_map": [
91
+ ["/description/i", "output"]
92
+ ]
93
+ }
94
+ }
95
+ ```
96
+
97
+ Configuring a result map does not replace the built-in mappings, the
98
+ configured mappings take precedence over them.
99
+
100
+ ### Result Status Map Examples
101
+
102
+ The configurable result status map allows you to define SNMP trap
103
+ varbind to numeric Sensu check result status value mappings. A
104
+ mapping is comprised of a varbind name regular expression and an check
105
+ exit status (e.g. 1-255). For example, if you expect SNMP traps with a
106
+ varbind name that contains "CriticalError" and you would like to set
107
+ the Sensu check result status to `2` (critical):
108
+
109
+ ``` json
110
+ {
111
+ "snmp_trap": {
112
+ "...": "...",
113
+ "result_status_map": [
114
+ ["/critical/i", 2]
115
+ ]
116
+ }
117
+ }
118
+ ```
119
+
120
+ Configuring a result status map does not replace the built-in
121
+ mappings, the configured mappings take precedence over them.
@@ -58,7 +58,9 @@ module Sensu
58
58
  :handlers => ["default"],
59
59
  :result_attributes => {},
60
60
  :result_map => [],
61
- :result_status_map => []
61
+ :result_status_map => [],
62
+ :client_socket_bind => "127.0.0.1",
63
+ :client_socket_port => 3030
62
64
  }
63
65
  @options.merge!(@settings[:snmp_trap]) if @settings[:snmp_trap].is_a?(Hash)
64
66
  @options
@@ -200,7 +202,7 @@ module Sensu
200
202
 
201
203
  def send_result(result)
202
204
  socket = UDPSocket.new
203
- socket.send(Sensu::JSON.dump(result), 0, "127.0.0.1", 3030)
205
+ socket.send(Sensu::JSON.dump(result), 0, options[:client_socket_bind], options[:client_socket_port])
204
206
  socket.close
205
207
  end
206
208
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-extensions-snmp-trap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Extensions and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-extension
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.6.3
142
+ rubygems_version: 2.5.2.1
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Check extension to receive SNMP traps and translate them into check results