Method: LinuxSystemInfo.memory

Defined in:
lib/components/memory.rb

.memoryObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/components/memory.rb', line 3

def memory
  ram = `free -m`
  ram = ram.split("\n")[1].split
  {
    :unit    => 'Megabyte',
    :total   => ram[1],
    :used    => ram[2],
    :free    => ram[3],
    :shared  => ram[4],
    :buffers => ram[5],
    :cached  => ram[6]
  }
end