You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
430 B

#!/bin/sh
set -o noclobber
me="meinfo"
LINE=$("$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1 ~/MemTotal:/) memtotal=$2; if ($1 ~/MemFree:/) memfree=$2; if ($1 ~/MemAvailable:/) memavailable=$2} END {if ( memtotal && memfree && memavailable ) printf "meminfo,host=%s mem_total=%si,mem_free=%si,mem_available=%si %s\n",myhost,memtotal,memfree,memavailable,time}' /proc/meminfo)
writeline "$LINE" "$MAXLINES" "$me"