cc-metric-collector/collectors/memavg/read_memavg.sh

13 lines
333 B
Bash
Raw Normal View History

2021-03-17 18:00:09 +01:00
#!/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)
2021-03-18 17:30:08 +01:00
echo "mem_total,host=$HOST value=$TOTAL"
echo "mem_avail,host=$HOST value=$AVAIL"
echo "mem_free,host=$HOST value=$FREE"