sensu-extensions-snmp-trap 0.0.2 → 0.0.3

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: cdc1fa9ecdfe03d04ab963dc1eee8cff0c746e7b
4
- data.tar.gz: c9e3132a277d5a8141ace01a26b701de2281c343
3
+ metadata.gz: 6c324a273c2cbcd929a2d5adc6ee9d3deeca3ed5
4
+ data.tar.gz: 827315e0fccf9bd178b95259cd48bf5c9a65504e
5
5
  SHA512:
6
- metadata.gz: e0464017da27b79c2fa86d39b61c6c58e1d291d527febed031a540b1291612404f1b44c96c8932a271a946544d32100a767d1dfcbc0599c4ec73aa39ad052e19
7
- data.tar.gz: ef6043f29a89d954e30a9c2b2a9d74f61fb6abbb842a43c92f87ad81e7ca1d2a16331a15d94f2ccbc3fb94ee35bc9cb8fa8fc5c5cf7aba567a049e8257826303
6
+ metadata.gz: a6ef00a8e398ba89fbd9c81678a9a215decfb24b468857aca6af646cbffaf75aeb17f8cace1721b12930dec1773c89b6792ded54f0c600be666c31ef09877f25
7
+ data.tar.gz: df6375c4f06dcc716e841713e13cc873e21d62a5e84408f06c72b18ea9bd762baefca927c1dc69658346ab6d48ce69a9440f775d78d4d72d717ca6f53a00a0e5
data/README.md CHANGED
@@ -1,11 +1,38 @@
1
- # Sensu::Extensions::Template
1
+ # Sensu SNMP Trap Check Extension
2
2
 
3
- Welcome to the Sensu Extensions repository template! In this repository, you will find the files you need to be able to author your own Sensu Extension for Sensu Core (>= 0.26).
3
+ Creates a SNMPv2 trap listener as part of the Sensu client process.
4
+ This SNMP trap extension loads MIBs and attempts to translate SNMP
5
+ traps into Sensu check results.
4
6
 
5
- ## Usage
7
+ ## Inspiration
6
8
 
7
- 1. Fork this repository and name the fork after your new extension, e.g. `"sensu-extensions-docker"`
9
+ This SNMP trap extension was inspired by the work done by Toby Jackson
10
+ on [SNMPTrapHandler](https://github.com/warmfusion/sensu-extension-snmptrap).
8
11
 
9
- 2. Write your extension (with tests!)
12
+ ## Installation
10
13
 
11
- 3. Create a GitHub issue on [sensu-extensions/template](https://github.com/sensu-extensions/template/issues) to request a review of your extension, to determine if it is ready to be moved to the [sensu-extensions GitHub organization](https://github.com/sensu-extensions) to be shared with the Sensu community!
14
+ ```
15
+ sensu-install -e snmp-trap
16
+ ```
17
+
18
+ Edit `/etc/sensu/conf.d/extensions.json` to load it.
19
+
20
+ ``` json
21
+ {
22
+ "extensions": {
23
+ "snmp-trap": {
24
+ "version": "0.0.2"
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## Configuration
31
+
32
+ |param|type|default|description|
33
+ |----|----|----|---|
34
+ |:bind|:string|0.0.0.0|IP to bind the SNMP trap listener to|
35
+ |:port|:integer|1062|Port to bind the SNMP trap listener to|
36
+ |:community|:string|"public"|SNMP community string to use|
37
+ |:handlers|:array|["default"]|Handlers to specify in Sensu check results|
38
+ |:mibs_dir|:string|"/etc/sensu/mibs"|MIBs directory to import and load MIBs from|
@@ -69,7 +69,14 @@ module Sensu
69
69
  @logger.debug("snmp trap check extension importing mibs", :mibs_dir => options[:mibs_dir])
70
70
  Dir.glob(File.join(options[:mibs_dir], "*")) do |mib_file|
71
71
  @logger.debug("snmp trap check extension importing mib", :mib_file => mib_file)
72
- SNMP::MIB.import_module(mib_file)
72
+ begin
73
+ SNMP::MIB.import_module(mib_file)
74
+ rescue StandardError, SyntaxError => error
75
+ @logger.debug("snmp trap check extension failed to import mib", {
76
+ :mib_file => mib_file,
77
+ :error => error
78
+ })
79
+ end
73
80
  end
74
81
  @mibs = SNMP::MIB.new
75
82
  @logger.debug("snmp trap check extension loading mibs")
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.2
4
+ version: 0.0.3
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: 2016-10-27 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-extension