nethacker / usagewatch

A Ruby Gem with methods to find usage statistics on a Linux server such as CPU, Disk, TCP/UDP Connections, Load, Bandwidth, Disk I/O, and Memory
MIT License
79 stars 38 forks source link

meminfo looking at wrong line #16

Open avongluck-r1soft opened 9 years ago

avongluck-r1soft commented 9 years ago

It looks like meminfo is examining line 5 for "Active:", but the offset for active has moved to line 6.

$ cat /proc/meminfo
MemTotal:       32915844 kB
MemFree:        12771756 kB
MemAvailable:   25949644 kB
Buffers:          308388 kB
Cached:         12658552 kB
SwapCached:            0 kB
Active:          6645692 kB
Inactive:        8302520 kB
Active(anon):    1982684 kB
Inactive(anon):    85144 kB

Likely should be going off of the field names vs fixed line offsets.

geocom commented 9 years ago

Take a look at my pull request #13. You can build it from my fork to have this happen

shlima commented 9 years ago

+1

evnix commented 8 years ago

Please apply the suggested patch https://github.com/nethacker/usagewatch/pull/13

yuri-karpovich commented 8 years ago

+1 for #13