10
edits
Changes
→Collect script
fi
fi
if [ "$update" -eq 1 ]; then
(
cat /proc/bc/$VPSID/resources | awk -v rrdfile=$RRDFILENAME '
BEGIN {
ORS="";
getline
keys=$1 "_f"; values=$6;
keys=keys ":" $1 "_h"; values=values ":" $2;
keys=keys ":" $1 "_b"; values=values ":" $4;
}
{
keys=keys ":" $1 "_f"; values=values ":" $6;
keys=keys ":" $1 "_h"; values=values ":" $2;
keys=keys ":" $1 "_b"; values=values ":" $4;
}
END { print "update " rrdfile " -t " keys " N:" values "\n"; } '
) | $command
fi
done