# Looking for help with RRDtool on IPFire

**URL:** <https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972>\
**Category:** Monitoring\
**Created:** [23 March 2021 18:29 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972 "2021-03-23T18:29:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon](https://community.ipfire.org/user_avatar/community.ipfire.org/jon/32/15363_2.png) [@jon](https://community.ipfire.org/u/jon)\
**Post date:** [23 March 2021 18:29 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972/1 "2021-03-23T18:29:55Z")

</div>

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](https://oss.oetiker.ch/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)](https://ipfire:444/cgi-bin/netinternal.cgi) 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!

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [23 March 2021 19:18 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972/2 "2021-03-23T19:18:54Z")

</div>

Hi Jon … way back I looked at this site and the first example, ping. [https://calomel.org/rrdtool.html](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.

---

<div class="post-metadata">

**Author:** ![jon](https://community.ipfire.org/user_avatar/community.ipfire.org/jon/32/15363_2.png) [@jon](https://community.ipfire.org/u/jon)\
**Post date:** [23 March 2021 19:38 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972/3 "2021-03-23T19:38:08Z")

</div>

Thank you! I’ll read thru it.

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

Jon

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [23 March 2021 20:10 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972/4 "2021-03-23T20:10:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![juha](https://community.ipfire.org/user_avatar/community.ipfire.org/juha/32/9987_2.png) [@juha](https://community.ipfire.org/u/juha)\
**Post date:** [24 March 2021 16:25 UTC](https://community.ipfire.org/t/looking-for-help-with-rrdtool-on-ipfire/4972/5 "2021-03-24T16:25:49Z")

</div>

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 🙂 .

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).
