mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-07-31 00:46:08 +02:00
Script version, no time loop
This commit is contained in:
3
collectors/memavg/config.json
Normal file
3
collectors/memavg/config.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"command": "read_memavg.sh"
|
||||
}
|
12
collectors/memavg/read_memavg.sh
Executable file
12
collectors/memavg/read_memavg.sh
Executable 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"
|
Reference in New Issue
Block a user