sloth-snmp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +73 -0
- data/README.adoc +1 -0
- data/README.ja.adoc +1 -0
- data/lib/sloth/snmp/impl.rb +1 -2
- data/lib/sloth/snmp/version.rb +1 -1
- data/sample/snmpcustom.rb +1 -1
- data/sample/snmpset.rb +8 -9
- data/sloth-snmp.gemspec +2 -2
- metadata +15 -15
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62191552bea1c596beac67f798984bf16d53ab168649047ab92e6475231496d8
|
4
|
+
data.tar.gz: ab19e1d899788e2e2d728c451fb7860dc1ab83d965a23164bff217ae86b4b95e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c7a5de590d02f36da31f944d425bbe319edecfe2c952121d2807477b6a65ecc372ccaf289ad25b4f69102fa08a4eb60dd146a3a8b9d13dba0d047a400211a7
|
7
|
+
data.tar.gz: 9b8eabf3493ab570cb0010adc38f05c6ece9b0bc3a9ec176f26c203b1d3c7c267376610eadc0ae66186cc6dd3fafa161b098d4b18bb27d2a43163754dea796b5
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
AllCops:
|
3
|
+
Exclude:
|
4
|
+
- '.*'
|
5
|
+
- '*'
|
6
|
+
- '*.gemspec'
|
7
|
+
- 'Gemfile*'
|
8
|
+
- 'bin/**'
|
9
|
+
- 'exe/**'
|
10
|
+
- 'config/**/*'
|
11
|
+
- 'spec/**/*'
|
12
|
+
- 'tmp/**/*'
|
13
|
+
- 'vendor/**/*'
|
14
|
+
TargetRubyVersion: 2.7
|
15
|
+
|
16
|
+
Layout/ExtraSpacing:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Layout/SpaceAroundOperators:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Layout/SpaceBeforeFirstArg:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Layout/SpaceInsideParens:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Layout/SpaceInsideRangeLiteral:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Layout/SpaceInsideReferenceBrackets:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Layout/SpaceInsideStringInterpolation:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Lint/AmbiguousBlockAssociation:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Lint/EmptyWhen:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Lint/ReturnInVoidContext:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Lint/UselessAssignment:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
Metrics/BlockLength:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
Metrics/LineLength:
|
56
|
+
Enabled: false
|
57
|
+
Max: 120
|
58
|
+
|
59
|
+
Metrics/MethodLength:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Style/Documentation:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Style/FrozenStringLiteralComment:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/NumericPredicate:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
Style/StringLiterals:
|
72
|
+
Enabled: false
|
73
|
+
|
data/README.adoc
CHANGED
data/README.ja.adoc
CHANGED
data/lib/sloth/snmp/impl.rb
CHANGED
@@ -7,8 +7,7 @@ module Sloth
|
|
7
7
|
|
8
8
|
class UDPTransportExt < ::SNMP::UDPTransport
|
9
9
|
def initialize( address_family, bindto: nil, device: nil )
|
10
|
-
super
|
11
|
-
@socket = UDPSocket.open( address_family )
|
10
|
+
super address_family
|
12
11
|
if bindto
|
13
12
|
host, port = bindto.split(':') rescue nil
|
14
13
|
@socket.bind( host, port.to_i )
|
data/lib/sloth/snmp/version.rb
CHANGED
data/sample/snmpcustom.rb
CHANGED
data/sample/snmpset.rb
CHANGED
@@ -15,16 +15,15 @@ peer = ARGV.shift || "127.0.0.1:161"
|
|
15
15
|
|
16
16
|
[
|
17
17
|
{ topic: "sysName.0", type: SNMP::OctetString, value: Time.now.to_s },
|
18
|
-
].each do |
|
19
|
-
p [:set,
|
20
|
-
pp Snmp.set( peer,
|
18
|
+
].each do |item|
|
19
|
+
p [:set, item]
|
20
|
+
pp Snmp.set( peer, item, **options )
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
tuples
|
26
|
-
|
27
|
-
p tuple_
|
22
|
+
topic = item[:topic]
|
23
|
+
p [:get, topic]
|
24
|
+
tuples = Snmp.get( peer, topic, **options )
|
25
|
+
tuples.each do |_oid, tuple|
|
26
|
+
p tuple
|
28
27
|
end
|
29
28
|
puts
|
30
29
|
end
|
data/sloth-snmp.gemspec
CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "snmp"
|
22
22
|
|
23
|
-
spec.add_development_dependency "rake"
|
24
|
-
spec.add_development_dependency "rspec"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec"
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sloth-snmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arimay
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: snmp
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
description: " Sloth::Snmp is yet another wrapper library for snmp. "
|
56
56
|
email:
|
57
57
|
- arima.yasuhiro@gmail.com
|
@@ -61,7 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
|
-
- ".
|
64
|
+
- ".rubocop.yml"
|
65
65
|
- Gemfile
|
66
66
|
- README.adoc
|
67
67
|
- README.ja.adoc
|
@@ -81,7 +81,7 @@ homepage: https://github.com/arimay/sloth-snmp
|
|
81
81
|
licenses:
|
82
82
|
- MIT
|
83
83
|
metadata: {}
|
84
|
-
post_install_message:
|
84
|
+
post_install_message:
|
85
85
|
rdoc_options: []
|
86
86
|
require_paths:
|
87
87
|
- lib
|
@@ -96,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
100
|
-
signing_key:
|
99
|
+
rubygems_version: 3.2.3
|
100
|
+
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Sloth Snmp Library.
|
103
103
|
test_files: []
|