openstk
openstk

Reputation: 137

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.

Upvotes: 1

Views: 235

Answers (1)

Tobi Oetiker
Tobi Oetiker

Reputation: 5460

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.

Upvotes: 1

Related Questions