sensu-plugins-snmp 0.0.3 → 0.0.4

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: 981861f0c8c4d1c6224b22f085bd38ab3171336c
4
- data.tar.gz: e9305f8fb476d104625eb2e2fbaaaf61c1490e46
3
+ metadata.gz: 0a3dc5871ee186fb00adf69e1ed79a306018c466
4
+ data.tar.gz: 0c1a1146ccafb8deeb21ab3a8248cb2f73b48064
5
5
  SHA512:
6
- metadata.gz: 058efc26776dbd20c0bb79b2c882ab34f442d824d858bc43a324ef3b631fd81c573903f65ab44c42ceea9ecedc74174d9fce198c616a4cbb92bb544da27c6bab
7
- data.tar.gz: 0958889fb4dd9a7f80bb307db5d7f148d2a3105b94cbc8a445eac0b2bbd49867368b76e24a70464cf286b751cb86bdf62d5783792b64ac07a65debad63fca112
6
+ metadata.gz: c7484dd3e1342151d2180a042a04c984de7f8f7eeb48fbbc14b0323f420cf42821e3d1d40b501d881b35c30da78da2865155233740940d55afd54ad371a5e4af
7
+ data.tar.gz: 88d7c8bc2ab442e2b5d8c3432ee1db436a53d2fa4eddad1e13d1c84994c1fb644405e695d4e426f0aa4181dee3a1cad2e6f233b1082a0fae521699b07873856c
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -3,7 +3,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
- ## Unreleased][unreleased]
6
+ ## [0.0.4] - 2015-07-22
7
+ ### Fixed
8
+ - Fixed graphite output when using a prefix in metrics-snmp-bulk.rb
9
+
10
+ ### Added
11
+ - Made suffix an optional flag in metrics-snmp-bulk.rb so you can choose exactly how to format your metrics output
7
12
 
8
13
  ## [0.0.3] - 2015-07-14
9
14
  ### Changed
data/bin/check-snmp.rb CHANGED
@@ -5,14 +5,16 @@
5
5
  # This is a simple SNMP check script for Sensu, We need to supply details like
6
6
  # Server, port, SNMP community, and Limits
7
7
  #
8
- #
9
- # Requires SNMP gem
8
+ # DEPENDENCIES:
9
+ # gem: sensu-plugin
10
+ # gem: snmp
10
11
  #
11
12
  # USAGE:
12
13
  #
13
14
  # check-snmp -h host -C community -O oid -w warning -c critical
14
15
  # check-snmp -h host -C community -O oid -m "(P|p)attern to match\.?"
15
16
  #
17
+ # LICENSE:
16
18
  #
17
19
  # Author Deepak Mohan Das <deepakmdass88@gmail.com>
18
20
  #
@@ -4,13 +4,15 @@
4
4
  #
5
5
  # This is a script to 'bulk walk' an SNMP OID value, collecting metrics
6
6
  #
7
- #
8
- # Requires SNMP gem
7
+ # DEPENDENCIES:
8
+ # gem: sensu-plugin
9
+ # gem: snmp
9
10
  #
10
11
  # USAGE:
11
12
  #
12
- # snmp-bulk-metrics -h host -C community -O oid1,oid2... -s suffix
13
+ # snmp-bulk-metrics -h host -C community -O oid1,oid2...
13
14
  #
15
+ # LICENSE:
14
16
  # Copyright 2014 Matthew Richardson <m.richardson@ed.ac.uk>
15
17
  # Based on snmp-metrics.rb by Double Negative Limited
16
18
  #
@@ -44,8 +46,7 @@ class SNMPGraphite < Sensu::Plugin::Metric::CLI::Graphite
44
46
 
45
47
  option :suffix,
46
48
  short: '-s suffix',
47
- description: 'suffix to attach to graphite path',
48
- required: true
49
+ description: 'suffix to attach to graphite path'
49
50
 
50
51
  option :snmp_version,
51
52
  short: '-v version',
@@ -104,13 +105,13 @@ class SNMPGraphite < Sensu::Plugin::Metric::CLI::Graphite
104
105
  name = vb.oid
105
106
  name = "#{name}".gsub('.', '_') if config[:graphite]
106
107
  begin
107
- if config[:prefix]
108
- output "#{config[:prefix]}.#{config[:host]}.#{config[:suffix]}.#{name}", value.to_f
109
- else
110
- output "#{config[:host]}.#{config[:suffix]}.#{name}", vb.value.to_f
111
- end
108
+ metric_string = config[:host]
109
+ metric_string = "#{config[:prefix]}.#{metric_string}" if config[:prefix]
110
+ metric_string += ".#{config[:suffix]}" if config[:suffix]
111
+ metric_string += ".#{name}"
112
+ output metric_string, vb.value.to_f
112
113
  rescue NameError # rubocop:disable all
113
- # Some values may fail to cast to float
114
+ # Rescue as some values may fail to cast to float
114
115
  end
115
116
  end
116
117
  manager.close
@@ -8,8 +8,11 @@
8
8
  # modern devices probably support. If there is no HC support, use --low-capacity
9
9
  # flag.
10
10
  #
11
- # Example
12
- # -------
11
+ # DEPENDENCIES:
12
+ # gem: sensu-plugin
13
+ # gem: snmp
14
+ #
15
+ # USAGE:
13
16
  #
14
17
  # snmp-if-metrics.rb -C community -h host
15
18
  #
@@ -27,12 +30,12 @@
27
30
  # - `--version`: Set SNMP protocol version (SNMPv2c or SNMPv1)
28
31
  # - `--low-capacity`: Use low capacity counters
29
32
  #
33
+ # LICENSE:
30
34
  # Copyright (c) 2013 Joe Miller
31
35
  #
32
36
  # Released under the same terms as Sensu (the MIT license); see LICENSE
33
37
  # for details.
34
38
 
35
- # #YELLOW
36
39
  # rubocop:disable VariableName
37
40
  require 'sensu-plugin/metric/cli'
38
41
  require 'snmp'
data/bin/metrics-snmp.rb CHANGED
@@ -4,13 +4,15 @@
4
4
  #
5
5
  # This is a simple script to collect metrics from a SNMP OID value
6
6
  #
7
- #
8
- # Requires SNMP gem
7
+ # DEPENDENCIES:
8
+ # gem: sensu-plugin
9
+ # gem: snmp
9
10
  #
10
11
  # USAGE:
11
12
  #
12
13
  # check-snmp -h host -C community -O oid -p prefix -s suffix
13
14
  #
15
+ # LICENSE:
14
16
  # Copyright (c) 2013 Double Negative Limited
15
17
  # Based on check-snmp.rb by Deepak Mohan Das <deepakmdass88@gmail.com>
16
18
  #
@@ -2,7 +2,7 @@ module SensuPluginsSnmp
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
33
+ date: 2015-07-22 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sensu-plugin
@@ -80,14 +80,14 @@ dependencies:
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: '0.30'
83
+ version: 0.32.1
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: '0.30'
90
+ version: 0.32.1
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
93
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file