[rrd-users] Re: question on mrtg/rrdtool

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Mon Sep 11 21:51:42 MEST 2000

Daniel R . Kilbourne wrote:
> I am using mrtg with rrdtool to monitor many things, one of hich is modem utilization. Some of the people (ie. my bosses) want to see the reported numbers on the png as whole numbers (ie. not 45.280, but 45). Is there a way to do this easily? (if it is in the manual feel free to tell me to RTFM).

Posting 80-char lines is RTFM (read about the 72-char recommendation!).
The answer to your question is partially answered on the mail list but
here it is anyway:

RRDtool wants to store the values at certain intervals.  Chances are
that you do not enter your values on those intervals.  RRDtool will try
and compensate for that, this is necessary to maintain good statistics.
However, in your case this is not welcome.  Okay, what you need to do is
enter your values on those intervals. (What you really *should* do is
explain to those people why this is necessary to have "real" numbers but
a bit of cheating is okay here).

If you made an MRTG compatible RRD the intervals are
- every  5 minutes for the "daily" archive
- every 30 minutes for the "weekly" archive
- every  2 hours   for the "monthly" archive
- every  1 day     for the "yearly" archive
in every case, start at 00:00 UTC (!)

Your boss wants whole numbers (presumably correct ones) so you have
only one option: collect your data only at 00:00 UTC and store it only
at 00:00 UTC.  Ask him/her if (s)he agrees.  Probably not so you start
negotiating:  There are a few choices:

a) Round the number to the nearest integer (use CDEFs)
b) Round the number up to the whole number (use CDEFs)
c) Have whole numbers for the daily archive and not for the others
d) Store actual numbers, not averages.  This is not a job for RRDtool.
   RRDtool stores the average over an interval

Option a will look like CDEF:inuse,0.5,-,ceil
Option b will look like CDEF:inuse,ceil
Option c is implemented by updating on certain times only:

if now is 968701573 (unix epoch time) update at 968701500.  This is
accomplished by:

   timenow = `date +%s`
   timenow = $((timenow/300*300))

in bash.  Other languages have similar methods of calculating the
current time minus (current_time modulo 300).

 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list