cow 0.1.4 → 0.1.6
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.
- checksums.yaml +7 -0
- data/cow.gemspec +2 -2
- data/lib/cow/application.rb +10 -0
- data/lib/cow/plugins/acs6000.rb +8 -0
- data/lib/cow/version.rb +1 -1
- metadata +21 -30
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a50ede7e2e35c954b46e7780eb7d6e7b2ccec1204ed24f7f2ade0297d1b7936
|
4
|
+
data.tar.gz: 3173e4a4dd6df09005ac6431a28e0a166b3ac09d51bdb404e669fd2486c1ecc1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e7f986a86ba283149dae428de3de6501b08809f840a9597f6df430fa9de48a000c43ce92500b693cbc326ac1eec8561b94481188cc859e614c3b4fba2d79ebef
|
7
|
+
data.tar.gz: 231b646f1b961f136b7a3f9106c71004f25acec9426fd3c1d1edad871fd8c0a1e5ada9c449d0e99b0a0db4e840916928064689a0b0330b25e1777fac5d2c73a9
|
data/cow.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
22
|
-
spec.add_development_dependency 'rake', '~>
|
21
|
+
spec.add_development_dependency 'bundler', '~> 2.1.0'
|
22
|
+
spec.add_development_dependency 'rake', '~> 12.3.3'
|
23
23
|
spec.add_dependency 'snmp'
|
24
24
|
end
|
data/lib/cow/application.rb
CHANGED
@@ -32,6 +32,16 @@ module Cow
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def create_cache(_cache = CACHE_FILE)
|
35
|
+
dir_name = File.dirname(_cache)
|
36
|
+
if !File.exist?(dir_name)
|
37
|
+
puts 'Cache directory is not found. Creating...'
|
38
|
+
Dir.mkdir(dir_name)
|
39
|
+
else
|
40
|
+
if !File.directory?(dir_name)
|
41
|
+
raise 'Cache directory path is already found but it is not a directory!!!'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
35
45
|
File.write(_cache, Cow::Application::Cache.new.to_yaml)
|
36
46
|
end
|
37
47
|
|
data/lib/cow/plugins/acs6000.rb
CHANGED
@@ -4,6 +4,7 @@ require 'snmp'
|
|
4
4
|
module Cow
|
5
5
|
module ACS6000
|
6
6
|
OID_DESCRIPTION_LIST = '1.3.6.1.4.1.10418.16.2.3.2.1.4'.freeze
|
7
|
+
OID_PORT_TABLE_PROFILE_LIST = '1.3.6.1.4.1.10418.16.2.3.2.1.5'.freeze
|
7
8
|
TCP_PORT_OFFSET = 7000
|
8
9
|
|
9
10
|
class Port < Cow::Tmpl::Port
|
@@ -18,8 +19,15 @@ module Cow
|
|
18
19
|
def get_ports
|
19
20
|
ret = []
|
20
21
|
snmp do |s|
|
22
|
+
port_profile_tables = {}
|
23
|
+
s.walk(OID_PORT_TABLE_PROFILE_LIST) do |x|
|
24
|
+
port_profile_tables[x.name.last.to_s] = x.value.to_i
|
25
|
+
end
|
26
|
+
|
21
27
|
s.walk(OID_DESCRIPTION_LIST) do |x|
|
22
28
|
next if x.name.last.zero?
|
29
|
+
next if x.value.to_s.length == 0
|
30
|
+
next if port_profile_tables[x.name.last.to_s] != 1 # other than CAS Profile
|
23
31
|
next unless (/^[0-9a-f]{2}-[0-9a-f]{2}-[0-9a-f]{2}-p-[0-9]+$/ =~ x.value.to_s).nil?
|
24
32
|
port = x.name.last
|
25
33
|
name = x.value.to_s
|
data/lib/cow/version.rb
CHANGED
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kazuki Shimizu
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-10-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 2.1.0
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 2.1.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
33
|
+
version: 12.3.3
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
version: 12.3.3
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: snmp
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Ease to connect console server ports
|
@@ -67,7 +60,7 @@ executables:
|
|
67
60
|
extensions: []
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
71
64
|
- Gemfile
|
72
65
|
- README.md
|
73
66
|
- Rakefile
|
@@ -86,26 +79,24 @@ files:
|
|
86
79
|
- lib/cow/version.rb
|
87
80
|
homepage: https://github.com/kazubu/cow/
|
88
81
|
licenses: []
|
89
|
-
|
82
|
+
metadata: {}
|
83
|
+
post_install_message:
|
90
84
|
rdoc_options: []
|
91
85
|
require_paths:
|
92
86
|
- lib
|
93
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
88
|
requirements:
|
96
|
-
- -
|
89
|
+
- - ">="
|
97
90
|
- !ruby/object:Gem::Version
|
98
91
|
version: '0'
|
99
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
93
|
requirements:
|
102
|
-
- -
|
94
|
+
- - ">="
|
103
95
|
- !ruby/object:Gem::Version
|
104
96
|
version: '0'
|
105
97
|
requirements: []
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
specification_version: 3
|
98
|
+
rubygems_version: 3.0.8
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
110
101
|
summary: Console server Wrapper
|
111
102
|
test_files: []
|