Permalink
Switch branches/tags
svn-trunk collectd-5.8.0 collectd-5.7.2 collectd-5.7.1 collectd-5.7.0 collectd-5.6.3 collectd-5.6.2 collectd-5.6.1 collectd-5.6.0 collectd-5.5.3 collectd-5.5.2 collectd-5.5.1 collectd-5.5.0 collectd-5.4.3 collectd-5.4.2 collectd-5.4.1 collectd-5.4.0 collectd-5.3.2 collectd-5.3.1 collectd-5.3.0 collectd-5.2.2 collectd-5.2.1 collectd-5.2.0 collectd-5.1.3 collectd-5.1.2 collectd-5.1.1 collectd-5.1.0 collectd-5.0.5 collectd-5.0.4 collectd-5.0.3 collectd-5.0.2 collectd-5.0.1 collectd-5.0.0 collectd-5.0.0-beta1 collectd-5.0.0-beta0 collectd-4.10.9 collectd-4.10.8 collectd-4.10.7 collectd-4.10.6 collectd-4.10.5 collectd-4.10.4 collectd-4.10.3 collectd-4.10.2 collectd-4.10.1 collectd-4.10.0 collectd-4.9.5 collectd-4.9.4 collectd-4.9.3 collectd-4.9.2 collectd-4.9.1 collectd-4.9.0 collectd-4.8.5 collectd-4.8.4 collectd-4.8.3 collectd-4.8.2 collectd-4.8.1 collectd-4.8.0 collectd-4.7.5 collectd-4.7.4 collectd-4.7.3 collectd-4.7.2 collectd-4.7.1 collectd-4.7.0 collectd-4.6.5 collectd-4.6.4 collectd-4.6.3 collectd-4.6.2 collectd-4.6.1 collectd-4.6.0 collectd-4.5.4 collectd-4.5.3 collectd-4.5.2 collectd-4.5.1 collectd-4.5.0 collectd-4.4.5 collectd-4.4.4 collectd-4.4.3 collectd-4.4.2 collectd-4.4.1 collectd-4.4.0 collectd-4.3.4 collectd-4.3.3 collectd-4.3.2 collectd-4.3.1 collectd-4.3.0 collectd-4.3.0beta1 collectd-4.3.0beta0 collectd-4.2.7 collectd-4.2.6 collectd-4.2.5 collectd-4.2.4 collectd-4.2.3 collectd-4.2.2 collectd-4.2.1 collectd-4.2.0 collectd-4.1.6 collectd-4.1.5 collectd-4.1.4 collectd-4.1.3 collectd-4.1.2
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 68 lines (57 sloc) 1.08 KB
#!/bin/bash
INPUT=$1
OUTPUT=$2
if [ -z "$INPUT" -o -z "$OUTPUT" ]
then
cat <<USAGE
Usage: $0 <input> <output>
USAGE
exit 1
fi
if [ ! -e "$INPUT" ]
then
echo "No such file: $INPUT"
exit 1
fi
if [ -e "$OUTPUT" ]
then
echo "File exists: $OUTPUT"
exit 1
fi
NUM_DS=0
rrdtool dump "$INPUT" | while read LINE
do
echo "$LINE"
if [ "$LINE" = "<ds>" ]
then
NUM_DS=$(($NUM_DS + 1))
fi
if [ "$LINE" = "<!-- Round Robin Archives -->" ]
then
for CF in MIN MAX AVERAGE
do
cat <<RRA
<rra>
<cf> $CF </cf>
<pdp_per_row> 1 </pdp_per_row>
<xff> 0.0000000000e+00 </xff>
<cdp_prep>
RRA
for ((i=0; i < $NUM_DS; i++))
do
echo " <ds><value> NaN </value> <unknown_datapoints> 1 </unknown_datapoints></ds>"
done
echo " </cdp_prep>"
echo " <database>"
DS_VALUES=`for ((i=0; i < $NUM_DS; i++)); do echo -n "<v> NaN </v>"; done`
for ((i=0; i < 2200; i++))
do
echo " <!-- $i --> <row>$DS_VALUES</row>"
done
echo " </database>"
echo " </rra>"
done
fi
done >"$OUTPUT.xml"
rrdtool restore "$OUTPUT.xml" "$OUTPUT" -r >/dev/null
rm -f "$OUTPUT.xml"