Looking for help with RRDtool on IPFire

Hello! For the past few month I’ve been working with pmacct on IPFire. And I’d like to figure out if I can transfer the data collected via pmacct and graph it via RRDtool.

Are there any RRDtool users that are willing to help? I am stuck on how to create the RRD database. I’ve read and tried the various RRD tutorials but the light is not coming on.

At the moment I am trying to copy the Net-Traffic graphs (internal) but I cannot determine how the GREEN0 (or blue or orange) graph is created. (I also don’t know perl - steep learning curve!)

Any help would be appreciated!

Hi Jon … way back I looked at this site and the first example, ping. https://calomel.org/rrdtool.html

There are 3 steps, init the database, update the database with cron, and make the graph. The Perl code runs a ping -q -n -c3 command, parses the output, and pushes two variables (pl, rtt) to the database.

Thank you! I’ll read thru it.

Did you use RRD? Or did this help you create something?

Jon

I followed the guide and made 3 scripts, init_db.sh, update_db.sh, and graph.sh, made the cron entries, and was able to make a Network (other ) graph, outside of ipfire.

When initializing the db, you figure out how many data points are collected per t and t so that the latency_db.rrd allocates enough rows. Initially the db is empty but as it fills up, it discards the old entries and brings the new ones (round robin). Say you collect 5 data per minute and need to keep one hour of data. Your db will init to 300 rows (5 * 60). Then at minute 61:00, the data will replace the first row, at 61:12 data will replace second row.

In ipfire, granularity of data for the DAY graph is every 10 minutes. I looked at the Network (other) graph which pings the gateway. The are 6 squares between one hour of the graph, from Tue 15:00 to Tue 16:00. But if you look at the HOUR data, granularity is every 1 minute.

Ipfire inits rrd database to one year of data taken every minute. That would be 525600 rows.

One way to learn how rrd organizes its data is to use rrdtool dump command on some .rrd file.

You can find the locations of .rrd files on IPFire with locate command (locate rrd will show them). To make that functional, it seem that updatedb must be run first. Seems that there is weekly cron job to do that, but you can make it faster manually :slight_smile: .

And to make that successfully, you need to manually create the directory where it saves its database, probably /var/lib/locate, but check the error message to be sure; it says that database such-and-such can not be created (the reason is that the containing directory does not exist).

2 Likes