specinfra 2.12.0 → 2.12.1

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
  SHA1:
3
- metadata.gz: 45b0dd4144407ae23367d089d595d93e24a52780
4
- data.tar.gz: e2fc78cba42b70f379fb8c1b45d6a6bdb92c5035
3
+ metadata.gz: e7564d361a058b557084abaadc28f77da9ef9dae
4
+ data.tar.gz: a4579ec7fecc3c2e7a65ddae762974d18642f451
5
5
  SHA512:
6
- metadata.gz: bf3bbf50b30218cb9d286804b16121f7b2a6d5180dc14c7e2e96e14d1596e9c7139963a44749fee7657f784a4a5d2afa19255a13f71b09e5d22127fde91c3800
7
- data.tar.gz: 86c4208d0fedd6178c15f7f4d5b97b77be7f8090ef786bf4bf52890182f8eddd9d43ea0237129aa3061c4268c4e608bac7a7a3e93e495d1f11a4ce933b7a0c4a
6
+ metadata.gz: 6ab735f0b9ba1a53c7749582969b65ea4a819ba7688ebc45d5e289ea6c3d04f2810eacc03b37d53caf03015c7ed5d0973872dbfbbfc86fd81cfcbde0659615f2
7
+ data.tar.gz: 827b0853dddf03c1d7a8bd749ab99d0e281bc8bb845c4f6a291ec7d96a447c11a4e478503ff2cd7e72c778a44ca7931987b3551a4267517eec15c9584b3f6a94
@@ -15,5 +15,9 @@ class Specinfra::Command::Linux::Base::Inventory < Specinfra::Command::Base::Inv
15
15
  def get_fqdn
16
16
  'hostname -f'
17
17
  end
18
+
19
+ def get_filesystem
20
+ 'df -P'
21
+ end
18
22
  end
19
23
  end
@@ -3,6 +3,9 @@ require 'specinfra/host_inventory/ec2'
3
3
  require 'specinfra/host_inventory/hostname'
4
4
  require 'specinfra/host_inventory/domain'
5
5
  require 'specinfra/host_inventory/fqdn'
6
+ require 'specinfra/host_inventory/platform'
7
+ require 'specinfra/host_inventory/platform_version'
8
+ require 'specinfra/host_inventory/filesystem'
6
9
 
7
10
  module Specinfra
8
11
  class HostInventory
@@ -1,3 +1,5 @@
1
+ require 'specinfra/ec2_metadata'
2
+
1
3
  module Specinfra
2
4
  class HostInventory
3
5
  class Ec2
@@ -0,0 +1,23 @@
1
+ module Specinfra
2
+ class HostInventory
3
+ class Filesystem
4
+ def self.get
5
+ cmd = Specinfra.command.get(:get_inventory_filesystem)
6
+ filesystem = {}
7
+ Specinfra.backend.run_command(cmd).stdout.lines do |line|
8
+ next if line =~ /^Filesystem\s+/
9
+ if line =~ /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+\%)\s+(.+)$/
10
+ device = $1
11
+ filesystem[device] = {}
12
+ filesystem[device]['kb_size'] = $2
13
+ filesystem[device]['kb_used'] = $3
14
+ filesystem[device]['kb_available'] = $4
15
+ filesystem[device]['percent_used'] = $5
16
+ filesystem[device]['mount'] = $6
17
+ end
18
+ end
19
+ filesystem
20
+ end
21
+ end
22
+ end
23
+ end
@@ -4,11 +4,57 @@ module Specinfra
4
4
  def self.get
5
5
  cmd = Specinfra.command.get(:get_inventory_memory)
6
6
  ret = Specinfra.backend.run_command(cmd).stdout
7
- memory = {}
7
+ memory = { 'swap' => {} }
8
8
  ret.each_line do |line|
9
9
  case line
10
+ when /^SwapCached:\s+(\d+) (.+)$/
11
+ memory['swap']['cached'] = "#{$1}#{$2}"
12
+ when /^SwapTotal:\s+(\d+) (.+)$/
13
+ memory['swap']['total'] = "#{$1}#{$2}"
14
+ when /^SwapFree:\s+(\d+) (.+)$/
15
+ memory['swap']['free'] = "#{$1}#{$2}"
10
16
  when /^MemTotal:\s+(\d+) (.+)$/
11
17
  memory['total'] = "#{$1}#{$2}"
18
+ when /^MemFree:\s+(\d+) (.+)$/
19
+ memory['free'] = "#{$1}#{$2}"
20
+ when /^Buffers:\s+(\d+) (.+)$/
21
+ memory['buffers'] = "#{$1}#{$2}"
22
+ when /^Cached:\s+(\d+) (.+)$/
23
+ memory['cached'] = "#{$1}#{$2}"
24
+ when /^Active:\s+(\d+) (.+)$/
25
+ memory['active'] = "#{$1}#{$2}"
26
+ when /^Inactive:\s+(\d+) (.+)$/
27
+ memory['inactive'] = "#{$1}#{$2}"
28
+ when /^Dirty:\s+(\d+) (.+)$/
29
+ memory['dirty'] = "#{$1}#{$2}"
30
+ when /^Writeback:\s+(\d+) (.+)$/
31
+ memory['writeback'] = "#{$1}#{$2}"
32
+ when /^AnonPages:\s+(\d+) (.+)$/
33
+ memory['anon_pages'] = "#{$1}#{$2}"
34
+ when /^Mapped:\s+(\d+) (.+)$/
35
+ memory['mapped'] = "#{$1}#{$2}"
36
+ when /^Slab:\s+(\d+) (.+)$/
37
+ memory['slab'] = "#{$1}#{$2}"
38
+ when /^SReclaimable:\s+(\d+) (.+)$/
39
+ memory['slab_reclaimable'] = "#{$1}#{$2}"
40
+ when /^SUnreclaim:\s+(\d+) (.+)$/
41
+ memory['slab_unreclaim'] = "#{$1}#{$2}"
42
+ when /^PageTables:\s+(\d+) (.+)$/
43
+ memory['page_tables'] = "#{$1}#{$2}"
44
+ when /^NFS_Unstable:\s+(\d+) (.+)$/
45
+ memory['nfs_unstable'] = "#{$1}#{$2}"
46
+ when /^Bounce:\s+(\d+) (.+)$/
47
+ memory['bounce'] = "#{$1}#{$2}"
48
+ when /^CommitLimit:\s+(\d+) (.+)$/
49
+ memory['commit_limit'] = "#{$1}#{$2}"
50
+ when /^Committed_AS:\s+(\d+) (.+)$/
51
+ memory['committed_as'] = "#{$1}#{$2}"
52
+ when /^VmallocTotal:\s+(\d+) (.+)$/
53
+ memory['vmalloc_total'] = "#{$1}#{$2}"
54
+ when /^VmallocUsed:\s+(\d+) (.+)$/
55
+ memory['vmalloc_used'] = "#{$1}#{$2}"
56
+ when /^VmallocChunk:\s+(\d+) (.+)$/
57
+ memory['vmalloc_chunk'] = "#{$1}#{$2}"
12
58
  end
13
59
  end
14
60
  memory
@@ -0,0 +1,9 @@
1
+ module Specinfra
2
+ class HostInventory
3
+ class Platform
4
+ def self.get
5
+ os[:family]
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ module Specinfra
2
+ class HostInventory
3
+ class PlatformVersion
4
+ def self.get
5
+ os[:release]
6
+ end
7
+ end
8
+ end
9
+ end
10
+
11
+
12
+
13
+
14
+
15
+
@@ -1,5 +1,3 @@
1
- require 'specinfra/ec2_metadata'
2
-
3
1
  module Specinfra
4
2
  class Processor
5
3
  def self.check_service_is_running(service)
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.12.0"
2
+ VERSION = "2.12.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -338,9 +338,12 @@ files:
338
338
  - lib/specinfra/host_inventory.rb
339
339
  - lib/specinfra/host_inventory/domain.rb
340
340
  - lib/specinfra/host_inventory/ec2.rb
341
+ - lib/specinfra/host_inventory/filesystem.rb
341
342
  - lib/specinfra/host_inventory/fqdn.rb
342
343
  - lib/specinfra/host_inventory/hostname.rb
343
344
  - lib/specinfra/host_inventory/memory.rb
345
+ - lib/specinfra/host_inventory/platform.rb
346
+ - lib/specinfra/host_inventory/platform_version.rb
344
347
  - lib/specinfra/processor.rb
345
348
  - lib/specinfra/properties.rb
346
349
  - lib/specinfra/runner.rb