Anonymous
public text v1 · immutable#!/bin/bash
while read timestamp inavg outavg; do
[ ${timestamp} -gt 0 ] && echo ${timestamp}, $(( ${inavg} * 8 )), $(( ${outavg} * 8 ))
done << EOF
$(rrdtool fetch ${1} AVERAGE -s e-24h \
-e $(date -d 'now - 10 mins' +'%s') \
| sort -r -k 1,10 \
| awk -F"(: | )" '{ printf "%s %.10g %.10g\n", $1, $2, $3 }' \
| awk '{ print int($1) " " int($2) " " int($3) }')
EOF