Search code examples
rrdtoolrrd

RRD DB fake value generator


I want to generate fake values in RRD DB for a period of 1 month and with 5 seconds as a frequency for data collection. Is there any tool which would fill RRD DB with fake data for given time duration.

I Googled a lot but did not find any such tool.

Please help.


Solution

  • I would recommend the following one liner:

    perl -e 'my $start = time - 30 * 24 * 3600; print join " ","update","my.rrd",(map { ($start+$_*5).":".rand} 0..(30*24*3600/5))' | rrdtool -
    

    this assumes you have an rrd file called my.rrd and that is contains just one data source expecting GAUGE type data.