[Orca-users] Help a newbie out

Blair Zajac blair at orcaware.com
Sat Apr 3 17:30:00 PST 2004


"Brian F." wrote:
> 
> The data is written at the end of the day, actually the file is output from
> a script that parses the actual logfile after the daily rotation. Since
> these log files are up to ~10gigs, it sometimes takes several hours to
> process them and output the data.Making the time issue a sticky problem. All
> the logs from 35 servers are sent off to the central logging server at
> midnight, and the central server parses the info. This sometimes takes up to
> 14 hours to process them all. So usually by about 2PM the next day, all of
> the logs are prepared. The problem i seem to have is telling orca or rrdtool
> to populate the data after the logs are parsed for 24 hour period ending at
> midnight the previous night. Is there a way to force it to not read time in
> a standard format, just assume that i'm giving it the information for 24
> hours in 1 hour intervals?
> Do you have a generic config file that i can spend some time with that does
> some common simple task?

Here's no easy way to tell Orca to read time besides using the
Unix epoch time and the last modified time of the input file.

In your case, you'll definitely need to add another column.  It
shouldn't be that hard.  Since you already know the day and the
hour, you can use the Time::Local perl module to get the Unix
epoch time:

NAME
       Time::Local - efficiently compute time from local and GMT time

SYNOPSIS
           $time = timelocal($sec,$min,$hour,$mday,$mon,$year);
           $time = timegm($sec,$min,$hour,$mday,$mon,$year);

DESCRIPTION
       These routines are the inverse of built-in perl functions localtime()
       and gmtime().  They accept a date as a six-element array, and return
       the corresponding time(2) value in seconds since the system epoch (Mid-
       night, January 1, 1970 UTC on Unix, for example).  This value can be
       positive or negative, though POSIX only requires support for positive
       values, so dates before the system's epoch may not work on all operat-
       ing systems.

Just fill in each field and get the time.  I would use timegm, since
I believe RRDtool works in GMT.

Best,
Blair

-- 
Blair Zajac <blair at orcaware.com>
Plots of your system's performance - http://www.orcaware.com/orca/



More information about the Orca-users mailing list