2019-01-04 02:26:46 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source ./commun.sh
|
|
|
|
|
|
|
|
ctime=$(date +'%s')
|
|
|
|
value=$(cut -d ' ' -f 1 /proc/loadavg)
|
|
|
|
|
2019-01-05 00:09:02 +11:00
|
|
|
# display and write value to a file
|
2019-01-04 02:26:46 +11:00
|
|
|
echo ${ctime} ${value} | tee -a bar.dat
|
|
|
|
|
|
|
|
# inject value in the rrdb file
|
|
|
|
rrdtool update $RRDB ${ctime}:${value}
|
|
|
|
|
|
|
|
|