fluent-plugin-snmp 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fluent::Plugin::Snmp
2
2
 
3
- Fluent plugin from snmp
3
+ Fluentd snmp input plugin
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,10 +8,6 @@ Add this line to your application's Gemfile:
8
8
 
9
9
  gem 'fluent-plugin-snmp'
10
10
 
11
- And then execute:
12
-
13
- $ bundle
14
-
15
11
  Or install it yourself as:
16
12
 
17
13
  $ gem install fluent-plugin-snmp
@@ -3,8 +3,8 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-snmp"
6
- gem.version = "0.0.3"
7
- gem.authors = ["Hiroshi Sugimoto"]
6
+ gem.version = "0.0.4"
7
+ gem.authors = ["hiro-su"]
8
8
  gem.email = ["h-sugimoto@iij.ad.jp"]
9
9
  gem.description = %q{Input plugin to walk snmp}
10
10
  gem.summary = %q{Input plugin to walk snmp}
@@ -1,5 +1,5 @@
1
1
  require 'snmp' # http://snmplib.rubyforge.org/doc/index.html
2
- require 'polling' # https://github.com/iij/polling.git
2
+ require 'polling'
3
3
 
4
4
  module Fluent
5
5
  class SnmpInput < Input
@@ -64,7 +64,7 @@ module Fluent
64
64
  @nodes = @nodes.split(',').map{|str| str.strip} unless @nodes.nil?
65
65
  raise ConfigError, "snmp: 'nodes' parameter is required on snmp input" if !@nodes.nil? && @nodes.empty?
66
66
 
67
- @polling_time = @polling_time.split(',').map{|str| str.strip.to_i} unless @polling_time.nil?
67
+ @polling_time = @polling_time.split(',').map{|str| str.strip} unless @polling_time.nil?
68
68
  raise ConfigError, "snmp: 'polling_time' parameter is required on snmp input" if !@polling_time.nil? && @polling_time.empty?
69
69
 
70
70
  # snmp version
data/snmp.conf.sample CHANGED
@@ -15,7 +15,6 @@ polling_time 0,10,20,30,40,50
15
15
  <source>
16
16
  type snmp
17
17
  tag snmp.server2
18
- nodes name, value
19
18
  host localhost
20
19
  community private
21
20
  version 2c
@@ -26,6 +25,19 @@ timeout 3s
26
25
  polling_time 5,15,25,35,45,55
27
26
  </source>
28
27
 
28
+ <source>
29
+ type snmp
30
+ tag snmp.server3
31
+ host localhost
32
+ community private
33
+ version 2c
34
+ mib hrStorageIndex, hrStorageDescr, hrStorageSize, hrStorageUsed
35
+ mib_modules HOST-RESOURCES-MIB
36
+ retries 0
37
+ timeout 3s
38
+ polling_time 5m
39
+ </source>
40
+
29
41
  <match snmp.server*>
30
42
  type stdout
31
43
  </match>
@@ -1,5 +1,5 @@
1
1
  require 'helper'
2
- require 'mocha'
2
+ require 'mocha/setup'
3
3
  require 'time'
4
4
 
5
5
  class SnmpInputTest < Test::Unit::TestCase
@@ -32,7 +32,7 @@ class SnmpInputTest < Test::Unit::TestCase
32
32
  assert_equal "snmp.server1", d.instance.tag
33
33
  assert_equal ["hrStorageIndex","hrStorageDescr","hrStorageSize","hrStorageUsed"], d.instance.mib
34
34
  assert_equal ["name","value"], d.instance.nodes
35
- assert_equal [0,10,20,30,40,50], d.instance.polling_time
35
+ assert_equal ["0","10","20","30","40","50"], d.instance.polling_time
36
36
 
37
37
  # SNMP Lib Params
38
38
  assert_equal "localhost", d.instance.host
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Hiroshi Sugimoto
8
+ - hiro-su
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-10 00:00:00.000000000 Z
12
+ date: 2012-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd