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 +4 -4
- data/lib/specinfra/command/linux/base/inventory.rb +4 -0
- data/lib/specinfra/host_inventory.rb +3 -0
- data/lib/specinfra/host_inventory/ec2.rb +2 -0
- data/lib/specinfra/host_inventory/filesystem.rb +23 -0
- data/lib/specinfra/host_inventory/memory.rb +47 -1
- data/lib/specinfra/host_inventory/platform.rb +9 -0
- data/lib/specinfra/host_inventory/platform_version.rb +15 -0
- data/lib/specinfra/processor.rb +0 -2
- data/lib/specinfra/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7564d361a058b557084abaadc28f77da9ef9dae
|
4
|
+
data.tar.gz: a4579ec7fecc3c2e7a65ddae762974d18642f451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab735f0b9ba1a53c7749582969b65ea4a819ba7688ebc45d5e289ea6c3d04f2810eacc03b37d53caf03015c7ed5d0973872dbfbbfc86fd81cfcbde0659615f2
|
7
|
+
data.tar.gz: 827b0853dddf03c1d7a8bd749ab99d0e281bc8bb845c4f6a291ec7d96a447c11a4e478503ff2cd7e72c778a44ca7931987b3551a4267517eec15c9584b3f6a94
|
@@ -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
|
@@ -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
|
data/lib/specinfra/processor.rb
CHANGED
data/lib/specinfra/version.rb
CHANGED
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.
|
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-
|
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
|