Hi, does anyone know of a memory check for Linux that checks available memory as opposed to free memory, check_mem.pl seems to only do free memory but its the lack of available memory that would actually cause me an issue so that's what I'd like to check.
total used free shared buff/cache available
Mem: 502 22 4 258 474 218
Cheers
Memory Check For Linux
Re: Memory Check For Linux
Hello sridgy,
If you'd like to check for available memory, the free and available memory are both listed from the free command on Linux and should be listed from the check_mem.pl script. From your post above, it seems that your available memory is the last one listed.
If you'd like a script the exclusively outputs available memory, you can make a bash script such as the following:
If you'd like to check for available memory, the free and available memory are both listed from the free command on Linux and should be listed from the check_mem.pl script. From your post above, it seems that your available memory is the last one listed.
If you'd like a script the exclusively outputs available memory, you can make a bash script such as the following:
Code: Select all
#!/bin/bash
available_mem=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
available_mem_mb=$((available_mem / 1024))
echo "Available Memory: ${available_mem_mb} MB"
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.