[rrd-users] How would you handle this?

Ulf Zimmermann ulf at openlane.com
Sat Apr 24 19:58:25 CEST 2010



> -----Original Message-----
> From: rrd-users-bounces+ulf=atc-onlane.com at lists.oetiker.ch
> [mailto:rrd-users-bounces+ulf=atc-onlane.com at lists.oetiker.ch] On
> Behalf Of Dave Wombat
> Sent: Thursday, April 22, 2010 3:47 PM
> To: Simon Hobson
> Cc: rrd-users at lists.oetiker.ch
> Subject: Re: [rrd-users] How would you handle this?
> 
> On Thu, Apr 22, 2010 at 3:34 PM, Simon Hobson <linux at thehobsons.co.uk>
> wrote:
> > Ulf Zimmermann wrote:
> >>I am looking at the logs of our fax servers, which run a card by
> >>Eicon. The logfile has information like call direction, which I
> >>would want to track as in, out and total, call time (start of call),
> >>call duration and port number plus other information which for
> >>tracking purpose I don't care about.
> >>
> >>I am thinking about running a script on this to feed into RRD maybe,
> >>like once an hour to check the previous hour. But how would you
> >>organize this in RRD?
> >
> > RRD will only track rates, so you cannot use it to track individual
> > calls or their start times. You could track number of calls, and
> > total durations.
> >
> > For logging number of calls, there are two ways of doing it. One is
> > to total the calls per unit of time in your scripts, and pass this in
> > as a data type absolute. The other would be to do an update for each
> > call and feed in the value 1 for each call made/received - again data
> > type absolute and assuming you don't ever have two calls on the same
> > second.
> >
> > Similarly, for call durations, you can either add them up for each
> > time period and do an update with that total, or do an update for
> > each call.
> >
> > --
> > Simon Hobson
> 
> I did something very much like what Simon describes except it was for
> PRI circuits (23 channels) and not a single FAX.  The call volume
> across
> the PRI made for interesting graphs.

This is for PRIs too and as this is for fax, call lengths are different between ports.

As a test I wrote a perl script which takes the call time (start of call) and duration. Translate call time into seconds since epoch, then use it to fill an associated array $count{$calltime} and in a loop doing the same for the next x seconds based on duration. Something like:

For ($a = $calltime; $a < $calltime+$duration; $a++) {
  $count{$a}++;
}




More information about the rrd-users mailing list