Method: Cisco::Platform.memory

Defined in:
lib/cisco_node_utils/platform.rb

.memoryObject

Return hash with keys “total”, “used”, “free” Ex: { ‘total’ => ‘16402252K’,

'used'  => '5909004K',
'free'  => '10493248K' }


52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cisco_node_utils/platform.rb', line 52

def self.memory
  total = config_get('memory', 'total')
  used = config_get('memory', 'used')
  free = config_get('memory', 'free')

  fail 'failed to retrieve platform memory information' if
    total.nil? || used.nil? || free.nil?

  {
    'total' => total,
    'used'  => used,
    'free'  => free,
  }
end