anamo 1.1.4 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf9f1e4e9a224b8d21dc1a308505807dedf13cbace8228c62ad600af2c8d4c81
4
- data.tar.gz: e4bbdfb3ed8b5e964c25ce7f068ea72abea96160a1deb3419d5dc1c4a665c1e5
3
+ metadata.gz: 585bdfa59d1816cf15caf399a5a5f1b68edb07e88ceaff4f98066ae8a446f0ff
4
+ data.tar.gz: fee35d1d0357dd8ff87110cebec9ba41396c9fb8e32a5be8ff48de75f37091e0
5
5
  SHA512:
6
- metadata.gz: beea20f667489122e2806b8500f2ded9ea08559b5e0fb54713717c42f371c65a3ad83bb1fa1a9b4ad5f6a10bc0c15585ac922a76cf1d7674a5f46adc239211a8
7
- data.tar.gz: cdd816ed6ecc1ca14803fa9210ac17b288e13c7c4039d608b5dc522ecd0085d4118ad68f621034c8cc3d35dcf81661e45e7e4f925312d430859ed4df11219222
6
+ metadata.gz: ca8f4d5b4dbbe9446e8894f00803dd9c6b5bb90dd0c137b80f69ff6da4a8ca84f71472bbffa69d197f700a15f15fe756e0c6152ce3272bcf71eb29fca8c39b0e
7
+ data.tar.gz: 90cad52413673704ecf4b2aa7fd6707dd327659753028f28f6dc51bd81658b460201657bef9de1d65c761478c85f973592e0d62ff2fca11e1bd035526d0a136d
@@ -7,8 +7,8 @@ module Anamo
7
7
 
8
8
  def initialize
9
9
  @api_base_url = 'https://app.anamo.io/api'
10
- @config = YAML.load_file "/etc/anamo.conf.yml"
11
- @client_key = File.exists?("/etc/anamo.client.key") ? File.open("/etc/anamo.client.key", 'rb') { |f| f.read } : nil
10
+ @config = YAML.load_file "/$HOME/anamo.conf.yml"
11
+ @client_key = File.exists?("/$HOME/anamo.client.key") ? File.open("/$HOME/anamo.client.key", 'rb') { |f| f.read } : nil
12
12
  end
13
13
 
14
14
  def make_url path
@@ -1,3 +1,3 @@
1
1
  ---
2
- api_key: 63ITKI8a0CrQQW06rK
2
+ api_key:
3
3
  modules: {}
@@ -37,8 +37,12 @@ module Anamo
37
37
 
38
38
  ret = {}
39
39
 
40
- config = YAML.load_file "/etc/anamo.conf.yml"
40
+ config = YAML.load_file "/$HOME/anamo.conf.yml"
41
+
42
+ #train
41
43
  train = Train.create('local')
44
+ # start or reuse a connection
45
+ conn = train.connection
42
46
 
43
47
  ret['api_key'] = config['api_key']
44
48
  ret['beacon_modules'] = config['modules']
@@ -48,12 +52,24 @@ module Anamo
48
52
  ret['node']['os_name'] = Train.create('local').connection.os[:name]
49
53
  ret['node']['os_family'] = Train.create('local').connection.os[:family]
50
54
  ret['node']['os_release'] = Train.create('local').connection.os[:release]
55
+
56
+ # run a command on Linux/Unix/Mac
57
+ ret['node']['cpe'] = conn.run_command('hostnamectl | grep "Static hostname: "').stdout
58
+ ret['node']['chassis'] = conn.run_command('hostnamectl | grep "Chassis: "').stdout
59
+ ret['node']['machine_id'] = conn.run_command('hostnamectl | grep "Machine ID: "').stdout
60
+ ret['node']['boot_id'] = conn.run_command('hostnamectl | grep "Boot ID: "').stdout
61
+ ret['node']['virtualization'] = conn.run_command('hostnamectl | grep "Virtualization: "').stdout
62
+ ret['node']['operating_system'] = conn.run_command('hostnamectl | grep "Operating System: "').stdout
63
+ ret['node']['kernel'] = conn.run_command('hostnamectl | grep "Kernel: "').stdout
64
+ ret['node']['architecture'] = conn.run_command('hostnamectl | grep "Architecture: "').stdout
65
+
66
+ #Uname (General)
51
67
  ret['node']['uname_sysname'] = Uname.sysname # => The operating system name. e.g. "SunOS"
52
68
  ret['node']['uname_machine'] = Uname.machine # => The machine hardware type. e.g. "i686"
53
69
  ret['node']['uname_version'] = Uname.version # => The operating system version. e.g. "5.8". Windows includes patch information.
54
70
  ret['node']['uname_release'] = Uname.release # => The operating system release. e.g. "2.2.16-3"
55
71
 
56
- #Solaris
72
+ #Uname (Solaris-Only)
57
73
  #ret['node']['uname_architecture'] = Uname.architecture # => Returns the instruction set architecture. e.g. "sparc"
58
74
  #ret['node']['uname_platform'] = Uname.platform # => The platform identifier. e.g. "SUNW,Sun-Blade-100"
59
75
  #ret['node']['uname_isa_list'] = Uname.isa_list # => List of supported instr. sets, e.g. "amd64 pentium_pro+mmx pentium_pro"
@@ -131,7 +147,7 @@ module Anamo
131
147
  if defined? @config_file_path
132
148
  @config_file_path
133
149
  else
134
- return '/etc/anamo.conf.yml'
150
+ return '/$HOME/anamo.conf.yml'
135
151
  end
136
152
  end
137
153
 
@@ -140,7 +156,7 @@ module Anamo
140
156
  private
141
157
 
142
158
  def key_file
143
- "/etc/anamo.client.key"
159
+ "/$HOME/anamo.client.key"
144
160
  end
145
161
 
146
162
  end
@@ -4,7 +4,7 @@ require 'yaml'
4
4
  if ARGV[0]
5
5
  path = ARGV[0]
6
6
  else
7
- path = '/etc/anamo.conf.yml'
7
+ path = '/$HOME/anamo.conf.yml'
8
8
  end
9
9
 
10
10
  config = YAML.load_file(path)
@@ -1,3 +1,3 @@
1
1
  module Anamo
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.9"
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.1.4
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anamo, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor