smartos-manager 1.2.2 → 1.2.3

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
  SHA1:
3
- metadata.gz: 3d4d607dfb2d449462a1f839c570233b2055eebf
4
- data.tar.gz: 92e92a570db5839078bca8312429df6dd1aa4d79
3
+ metadata.gz: 0499b9b28184c6d4d3d911c29591da43898219a5
4
+ data.tar.gz: f1322821f09a0600fc92986c849a65db9029c701
5
5
  SHA512:
6
- metadata.gz: 32cf2b180e3cab81658df3f99895644d085cc4b0abb2971efac9690a68aeeab494cb116add12b6abf094e7a4b1344148ef99f46c7762457711f966295062c5ed
7
- data.tar.gz: ef71c9907c80ee5151bb4b839e20621da612094e36308a91305d28dfc5563de63c07b1d1ef8e0d5e6ba9798694ea1087d02ea08bba817e4a9fa701814bf1bb13
6
+ metadata.gz: b4de8287fe2a4931b7212397767ce218f3d151642adc3f2734248112f57d5b88c7edbb4bb5da0e30234cf130d0d57395b9059a457c53d86cced1786ad81bcfdd
7
+ data.tar.gz: 46f9e9a36e913527380c6d4e1bf5c87728a2e0db5b377d97814224da9cdc7baff1e3d7a9c6e2da673f1cf30eb018af3253bbdd4c40794fb9df75280813ceabcd
@@ -8,7 +8,7 @@ class ColorPicker
8
8
 
9
9
  def initialize
10
10
  @colors = {}
11
- @available_colors = %w(green yellow red cyan magenta blue)
11
+ @available_colors = %w(green yellow cyan magenta blue red)
12
12
  end
13
13
 
14
14
  def get(str)
@@ -26,6 +26,7 @@ class AppCLI < Thor
26
26
  rev_colors = ColorPicker.new
27
27
 
28
28
  sysinfos = registry.sysinfo()
29
+ diags = registry.diag()
29
30
 
30
31
  user_columns = registry.user_columns.keys.map{|s| humanize(s) }
31
32
 
@@ -42,7 +43,8 @@ class AppCLI < Thor
42
43
  avail = [1, (mem - vm_memory) - zfs_arc_reserved].max
43
44
 
44
45
  rev = sysinfos[host][:smartos_version]
45
- puts "\n#{host.name} [SmartOS: #{rev.send(rev_colors.get(rev))}] (#{host.address}) (#{vms.size} vms) (Total RAM: #{mem.human_size(1).green}, ZFS: #{format_size(zfs_arc_current)}G/#{format_size(zfs_arc_reserved)}G, Avail: #{avail.human_size(1).magenta})"
46
+ puts "\nHardware: #{diags[host][:system_id]}"
47
+ puts "#{host.name} [SmartOS: #{rev.send(rev_colors.get(rev))}] (#{host.address}) (Total RAM: #{mem.human_size(1).green} [Free Slots: #{diags[host][:free_memory_banks]}], ZFS: #{format_size(zfs_arc_current)}G/#{format_size(zfs_arc_reserved)}G, Avail: #{avail.human_size(1).magenta})"
46
48
  vms.each do |vm|
47
49
  user_columns = registry.user_columns.values.map{|key| vm[key] }
48
50
  p_vm_list(vm.memory.human_size(1), vm.name, vm.type, vm.uuid, printable_state(vm.state), vm.admin_ip, *user_columns)
@@ -143,6 +143,25 @@ class HostRegistry
143
143
 
144
144
  end
145
145
 
146
+ def diag
147
+ ret = {}
148
+
149
+ run_on_all("prtdiag").each do |host, data|
150
+ free_memory_banks = 0
151
+
152
+ system_id = data.match(/^System Configuration: (.+)$/)[1]
153
+ data.scan(/(empty).*DIMM\s+([0-9])/).each do |reg|
154
+ free_memory_banks+= 1
155
+ end
156
+
157
+ ret[host] = {
158
+ system_id: system_id,
159
+ free_memory_banks: free_memory_banks
160
+ }
161
+ end
162
+
163
+ ret
164
+ end
146
165
 
147
166
  def sysinfo
148
167
  ret = {}
@@ -1,3 +1,3 @@
1
1
  module SmartosManager
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartos-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Ammous
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.2.1
152
+ rubygems_version: 2.2.2
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: "... ."