38a20c881e
In order to be more crontab friendly, fluxplug will be the only executable called by cron in an every minute job, Something like * * * * * /path/to/fluxplug >/dev/null 2>&1 Signed-off-by: Nagy Károly Gábriel <k@jpi.io>
11 lines
430 B
Bash
11 lines
430 B
Bash
#!/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"
|
|
|