Freemius / server-monitoring

NewRelic email alerts alternative by Freemius
https://freemius.com
MIT License
62 stars 37 forks source link

Issues with Ram/Swap #4

Open Mte90 opened 6 years ago

Mte90 commented 6 years ago

I got Memory 0 with the script but is impossible.

So checking on the code I got:

[domain@machine ~]$ free -m                                                                                                                          
              total        used        free      shared  buff/cache   available                                                                      
Mem:         128817        8881        9009        5416      110926      112742                                                                      
Swap:         16383          13       16370
[domain@machine ~]$ free -m | awk 'NR==3{print $3}'
13

Seems that take the value from swap on the wrong line

Mte90 commented 6 years ago

I patched using: local USED_MEM=$( free -m | awk 'NR==2{print $3}' )