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.

15 lines
512 B

#!/bin/sh
set -o noclobber
old=$PWD
cd $(dirname $(readlink -f "$0"))
cd ../
FLUXPLUGHOME=$PWD
. "$FLUXPLUGHOME"/master
cd $old
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"