anamo 1.0.4 → 1.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef520bc64a5c29d0378efd7ee68e4770b2fc56fc84494e5cbb103fa8ebfc73c1
4
- data.tar.gz: 918158a056482cf3a07f53c7bb6953fac7fc37ce2382b233129521b665d1b287
3
+ metadata.gz: 8710fa69bba9fa27a00b89f0a4f15f2fb5f1dcc23d2b968bb11f6dbecc047501
4
+ data.tar.gz: d016007e6d6451f7bdd1457f3fe310f09a38b7d0f012e4bb9af19e89331641c5
5
5
  SHA512:
6
- metadata.gz: 932b86e1cb4acf7213cc8452ce9280b712bc63480ee093303ad931a579f771358214920f119ba0fc569fcb79550d533543eb28877dd31fa950e895a595c25371
7
- data.tar.gz: 55421fe4e025121f60a1baf9c26c7d9ddf6f59d622354cb2f2d2819bf37f52065a427bab792281c4402dba45274befbfe747c9f5573c462438bee7cae71594e4
6
+ metadata.gz: 2a060b354356c409f5e145377ad1f4c808b7a5600a27525f6193ca63c7481f27b0e90f42756c02d6b37c0fb2bee37a445efc745295cbce234c66824267aeb050
7
+ data.tar.gz: e8ebc708ea75d392b5ce268ad4547d1441d2ffb2beeaaae7d33af7054c38cad8af349983311110296bb17b8cf3ff66e0a1b70d148a81e3ad9916b7a1f66a3e5d
@@ -0,0 +1,3 @@
1
+ ---
2
+ api_key: 63ITKI8a0CrQQW06rK
3
+ modules: {}
@@ -3,6 +3,9 @@ require 'thor'
3
3
  require 'anamo/api'
4
4
  require 'socket'
5
5
  require 'yaml'
6
+ require 'train'
7
+ require 'sys/uname'
8
+ include Sys
6
9
 
7
10
  module Anamo
8
11
  module Node
@@ -35,12 +38,39 @@ module Anamo
35
38
  ret = {}
36
39
 
37
40
  config = YAML.load_file "/etc/anamo.conf.yml"
41
+ train = Train.create('local')
38
42
 
39
43
  ret['api_key'] = config['api_key']
40
44
  ret['beacon_modules'] = config['modules']
41
45
  ret['node'] = {}
42
46
  ret['node']['hostname'] = Socket.gethostname
43
47
  ret['node']['ips'] = Socket.ip_address_list.map(){ |entry| entry.ip_address }.uniq
48
+ ret['node']['os_name'] = Train.create('local').connection.os[:name]
49
+ ret['node']['os_family'] = Train.create('local').connection.os[:family]
50
+ ret['node']['os_release'] = Train.create('local').connection.os[:release]
51
+
52
+ # run a command on Linux/Unix/Mac
53
+ ret['node']['cpe'] conn.run_command('hostnamectl | grep "Static hostname: "').stdout
54
+ ret['node']['chassis'] conn.run_command('hostnamectl | grep "Chassis: "').stdout
55
+ ret['node']['machine_id'] conn.run_command('hostnamectl | grep "Machine ID: "').stdout
56
+ ret['node']['boot_id'] conn.run_command('hostnamectl | grep "Boot ID: "').stdout
57
+ ret['node']['virtualization'] conn.run_command('hostnamectl | grep "Virtualization: "').stdout
58
+ ret['node']['operating_system'] conn.run_command('hostnamectl | grep "Operating System: "').stdout
59
+ ret['node']['kernel'] conn.run_command('hostnamectl | grep "Kernel: "').stdout
60
+ ret['node']['architecture'] conn.run_command('hostnamectl | grep "Architecture: "').stdout
61
+
62
+ #Uname (General)
63
+ ret['node']['uname_sysname'] = Uname.sysname # => The operating system name. e.g. "SunOS"
64
+ ret['node']['uname_machine'] = Uname.machine # => The machine hardware type. e.g. "i686"
65
+ ret['node']['uname_version'] = Uname.version # => The operating system version. e.g. "5.8". Windows includes patch information.
66
+ ret['node']['uname_release'] = Uname.release # => The operating system release. e.g. "2.2.16-3"
67
+
68
+ #Uname (Solaris-Only)
69
+ #ret['node']['uname_architecture'] = Uname.architecture # => Returns the instruction set architecture. e.g. "sparc"
70
+ #ret['node']['uname_platform'] = Uname.platform # => The platform identifier. e.g. "SUNW,Sun-Blade-100"
71
+ #ret['node']['uname_isa_list'] = Uname.isa_list # => List of supported instr. sets, e.g. "amd64 pentium_pro+mmx pentium_pro"
72
+ #ret['node']['uname_hw_provider'] = Uname.hw_provider # => The name of the hardware manufacturer.
73
+ #ret['node']['uname_hw_serial_number'] = Uname.hw_provider # => Uname.hw_serial_number # => The hardware serial number
44
74
 
45
75
  puts ret if output
46
76
 
@@ -127,4 +157,4 @@ module Anamo
127
157
 
128
158
  end
129
159
  end
130
- end
160
+ end
@@ -1,3 +1,3 @@
1
1
  module Anamo
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
- - US ProTech
7
+ - Anamo, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-23 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: train
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sys-uname
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: bundler
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +122,7 @@ dependencies:
94
122
  - - ">="
95
123
  - !ruby/object:Gem::Version
96
124
  version: '0'
97
- description: Anamo agent
125
+ description: Linux agent for app.anamo.io
98
126
  email:
99
127
  - jp@usprotech.com
100
128
  executables:
@@ -109,6 +137,7 @@ files:
109
137
  - lib/anamo/api.rb
110
138
  - lib/anamo/fstree/thor.rb
111
139
  - lib/anamo/groups/thor.rb
140
+ - lib/anamo/node/start
112
141
  - lib/anamo/node/thor.rb
113
142
  - lib/anamo/pkgver/thor.rb
114
143
  - lib/anamo/ports/thor.rb