Skip to content

Memory graph not working on CentOS 7 #498

@pschiffe

Description

@pschiffe

Hello,

CentOS 7 has different output of free -m command than CentOS 6:
CentOS 6:

# free -m
             total       used       free     shared    buffers     cached
Mem:          1877       1610        267          1        123        710
-/+ buffers/cache:        775       1101 
Swap:            0          0          0

CentOS 7:

# free -m
              total        used        free      shared  buff/cache   available
Mem:           1840         205         559          13        1076        1472
Swap:             0           0           0

And because vesta is parsing this output as (in v-update-sys-rrd-mem):

    mem=$(free -m)
    used=$(echo "$mem" |awk '{print $3}'|head -n3 |tail -n1)
    free=$(echo "$mem" |awk '{print $4}'|head -n3 |tail -n1)
    swap=$(echo "$mem" |awk '{print $3}'|tail -n1)

It always shows zero. Head command needs to be head -n 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions