corona 0.0.13 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -1
- data/corona.gemspec +7 -6
- data/lib/corona/core.rb +4 -3
- data/lib/corona/model.rb +27 -9
- metadata +28 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea06b286bb7a62e0e0a19c0edf19468cbdc0d54b
|
4
|
+
data.tar.gz: 10941c38185636518ef16949f0e22d4d1bf36e2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974eeea19e8432829a74201a6f1a7b6397d1ab837d5bfa328d1e89473e09210803abd4970628c132ab0f2b4ae415668777c98454676b7cbade115ef72c0d327b
|
7
|
+
data.tar.gz: da1f4695e9d5523e1d7e5bd2c76e7c75d3b942d751473d3ad4016437616c6ca4f32b12ce3a0152d460c2511c964eff4535eb0b0819310b2c58cf136c9a2ddb40
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/corona.gemspec
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'corona'
|
3
|
-
s.version = '0.0
|
3
|
+
s.version = '0.1.0'
|
4
|
+
s.licenses = ['Apache-2.0']
|
4
5
|
s.platform = Gem::Platform::RUBY
|
5
6
|
s.authors = [ 'Saku Ytti' ]
|
6
7
|
s.email = %w( saku@ytti.fi )
|
@@ -12,9 +13,9 @@ Gem::Specification.new do |s|
|
|
12
13
|
s.executables = %w( corona )
|
13
14
|
s.require_path = 'lib'
|
14
15
|
|
15
|
-
s.add_dependency 'sequel'
|
16
|
-
s.add_dependency 'sqlite3'
|
17
|
-
s.add_dependency 'snmp'
|
18
|
-
s.add_dependency 'slop'
|
19
|
-
s.add_dependency 'asetus'
|
16
|
+
s.add_dependency 'sequel', '~> 4.12'
|
17
|
+
s.add_dependency 'sqlite3', '~> 1.3'
|
18
|
+
s.add_dependency 'snmp', '~> 1.2'
|
19
|
+
s.add_dependency 'slop', '~> 3.5'
|
20
|
+
s.add_dependency 'asetus', '~> 0.1'
|
20
21
|
end
|
data/lib/corona/core.rb
CHANGED
@@ -56,14 +56,15 @@ module Corona
|
|
56
56
|
snmp = SNMP.new ip.to_s, @community
|
57
57
|
oids = snmp.dbget
|
58
58
|
if oids
|
59
|
+
result = {:oids=>oids, :ip=>ip, :int=>'n/a'}
|
59
60
|
if index = snmp.ip2index(ip.to_s)
|
60
61
|
if int = snmp.ifdescr(index)
|
61
|
-
result
|
62
|
+
result[:int] => int.downcase
|
62
63
|
else
|
63
|
-
Log.
|
64
|
+
Log.debug "no ifDescr for #{index} at #{ip}"
|
64
65
|
end
|
65
66
|
else
|
66
|
-
Log.
|
67
|
+
Log.debug "no ifIndex for #{ip}"
|
67
68
|
end
|
68
69
|
end
|
69
70
|
snmp.close
|
data/lib/corona/model.rb
CHANGED
@@ -10,27 +10,33 @@ module Corona
|
|
10
10
|
'iosxr'
|
11
11
|
when /NX-OS/
|
12
12
|
'nxos'
|
13
|
-
when /cisco/i, /Application Control Engine/i
|
14
|
-
'ios'
|
15
13
|
when /JUNOS/
|
16
14
|
'junos'
|
17
|
-
when /^NetScreen/, /^SSG-\d+/
|
18
|
-
'screenos'
|
19
15
|
when /Arista Networks EOS/
|
20
16
|
'eos'
|
21
17
|
when /IronWare/
|
22
18
|
'ironware'
|
23
|
-
when /^Summit/
|
24
|
-
'xos'
|
25
19
|
when /TiMOS/
|
26
20
|
'timos'
|
21
|
+
when /Cisco Adaptive Security Appliance/
|
22
|
+
'asa'
|
23
|
+
when /Brocade Fibre Channel Switch/
|
24
|
+
'fabricos'
|
25
|
+
when /cisco/i, /Application Control Engine/i
|
26
|
+
'ios'
|
27
|
+
when /Force10 OS/
|
28
|
+
'ftos'
|
29
|
+
when /^NetScreen/, /^SSG-\d+/
|
30
|
+
'screenos'
|
31
|
+
when /^Summit/
|
32
|
+
'xos'
|
27
33
|
when /^Alcatel-Lucent \S+ [789]\./ #aos <7 is vxworks, >=7 is linux
|
28
34
|
'aos7'
|
29
35
|
when /^AOS-W/
|
30
36
|
'aosw'
|
31
37
|
when /^Alcatel-Lucent/
|
32
38
|
'aos'
|
33
|
-
when
|
39
|
+
when /\s+ACOS\s+/
|
34
40
|
'acos'
|
35
41
|
when /ProCurve/ # ProCurve OS does not seem to have name?
|
36
42
|
'procurve'
|
@@ -39,9 +45,21 @@ module Corona
|
|
39
45
|
else
|
40
46
|
case sysObjectID
|
41
47
|
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.12356.'))
|
42
|
-
'fortios'
|
48
|
+
'fortios' # 1.3.6.1.4.1.12356.101.1.10004
|
43
49
|
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.6486.'))
|
44
|
-
'aos'
|
50
|
+
'aos' # 1.3.6.1.4.1.6486.800.1.1.2.1.11.2.2
|
51
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.6027.'))
|
52
|
+
'ftos' # 1.3.6.1.4.1.6027.1.3.4
|
53
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.1588.'))
|
54
|
+
'fabricos ' # 1.3.6.1.4.1.1588.2.1.1.1
|
55
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.3224.'))
|
56
|
+
'screenos' # 1.3.6.1.4.1.3224.1.51 (SSG) 1.16 (Netscreen 2k)
|
57
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.674.'))
|
58
|
+
'powerconnect' # 1.3.6.1.4.1.674.10895.3031
|
59
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.22610.'))
|
60
|
+
'acos' # 1.3.6.1.4.1.22610.1.3.14
|
61
|
+
when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.9.1.745'))
|
62
|
+
'asa' # 1.3.6.1.4.1.9.1.745
|
45
63
|
else
|
46
64
|
'unsupported'
|
47
65
|
end
|
metadata
CHANGED
@@ -1,85 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corona
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.12'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.3'
|
34
34
|
type: :runtime
|
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: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: snmp
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.2'
|
48
48
|
type: :runtime
|
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: '1.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: slop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.5'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: asetus
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.1'
|
83
83
|
description: Threaded SNMP poll based network discovery. Devices are stored in SQL
|
84
84
|
email:
|
85
85
|
- saku@ytti.fi
|
@@ -88,7 +88,7 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .rspec
|
91
|
+
- ".rspec"
|
92
92
|
- Gemfile
|
93
93
|
- Gemfile.lock
|
94
94
|
- README.md
|
@@ -106,7 +106,8 @@ files:
|
|
106
106
|
- lib/corona/model.rb
|
107
107
|
- lib/corona/snmp.rb
|
108
108
|
homepage: http://github.com/ytti/corona
|
109
|
-
licenses:
|
109
|
+
licenses:
|
110
|
+
- Apache-2.0
|
110
111
|
metadata: {}
|
111
112
|
post_install_message:
|
112
113
|
rdoc_options: []
|
@@ -114,17 +115,17 @@ require_paths:
|
|
114
115
|
- lib
|
115
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
117
|
requirements:
|
117
|
-
- -
|
118
|
+
- - ">="
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
122
|
requirements:
|
122
|
-
- -
|
123
|
+
- - ">="
|
123
124
|
- !ruby/object:Gem::Version
|
124
125
|
version: '0'
|
125
126
|
requirements: []
|
126
127
|
rubyforge_project: corona
|
127
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.2.2
|
128
129
|
signing_key:
|
129
130
|
specification_version: 4
|
130
131
|
summary: device discovery via snmp polls
|