Script version, no time loop

This commit is contained in:
Thomas Roehl
2021-03-17 18:00:09 +01:00
parent 79149b3c12
commit 24c5a80585
6 changed files with 288 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
{
"command": "read_memavg.sh"
}

View File

@@ -0,0 +1,12 @@
#!/bin/bash
TOTAL=$(grep "MemTotal" /proc/meminfo | awk '{print $2}')
AVAIL=$(grep "MemAvailable" /proc/meminfo | awk '{print $2}')
FREE=$(grep "MemFree" /proc/meminfo | awk '{print $2}')
HOST=$(hostname -s)
echo "mem_total,host=$HOST $TOTAL"
echo "mem_avail,host=$HOST $AVAIL"
echo "mem_free,host=$HOST $FREE"