#!/usr/bin/env sh if [ "$2" = "" ]; then num=30; else num=$2; fi for nn in $1/rrd/*; do echo "checking $nn" rrdtool fetch $nn -s -$num AVERAGE echo;echo done