[Orca-users] RE: number of columns does not match column descri ption (NOT)

Ambrose, Mark mark.ambrose at nomura.co.uk
Fri Aug 4 02:39:57 PDT 2000


I have orcallator running on some volatile servers where the number of
columns can change several times a time.

The way I got around this problem was by making orcallator.se output to a
new file each time the columns change (e.g. the variable print_header has
been set to 1). I just added an incrementing number to the file name.

You need to change the orcallator.cfg file to pick up the new format

Hope this helps

Cheers

Mark


// Sets ofile to the output file pointer.  Creates or appends to the
// log file if OUTDIR is set, otherwise sets the file pointer to STDOUT.
// It start a new log file each day.  It compresses the previous days
// log file if the environmental variable COMPRESSOR is set.
checkoutput(tm_t now) {
  string outdir = getenv("OUTDIR");
  tm_t   then;
  char   tm_buf[32];
  stat_t statbuf;
  string outnameZ;

  if (outdir == nil) {
    // No output dir so use stdout.
    if (ofile == 0) {
      //  First time, so print header and set ofile.
      ofile = stdout;
      print_header = 1;
    }
    return;
  }

// Maintain daily output logfiles in OUTDIR.
// Added 'print_header' option to force new file name if number of columns
change
  if (now.tm_yday != then.tm_yday || print_header == 1) {
// First time or day has changed, start new logfile.
      if (ofile != 0) {
// Close and optionally compress the existing output file.
          fclose(ofile);
          if (compress != nil) { system(sprintf(compress, outname)); }
      }
    

//    strftime(tm_buf, sizeof(tm_buf), "%Y-%m-%d", now);
//    outname = sprintf("%s/percol-%s", outdir,file_number,tm_buf);
//    Open for append either way.
//*************************************************
//*************************************************
//***************************************************
// Check for file name and file name.Z
// If already exists, create new file name
      file_number=0;
      while (1 == 1) {
           strftime(tm_buf, sizeof(tm_buf), "%Y-%m-%d", now);
          outname = sprintf("%s/percol%03d-%s",outdir,file_number,tm_buf);
          outnameZ = sprintf("%s.Z",outname);
          ofile = stat(outname,statbuf);
          if (ofile == -1) {
             ofile = stat(outnameZ,statbuf);
             if (ofile == -1) {break;};
          }
          else {
              if (compress != nil) { system(sprintf(compress, outname)); }
          }
          file_number++;
      }
//***************************************************
//***************************************************
//***************************************************
      ofile = fopen(outname, "a");
      if (ofile == 0) {
          perror("can't open output logfile");
          exit(1);
      }
// Always write header.
      print_header = 1;
      then = now;
  }
}


-----Original Message-----
From: Blair Zajac [mailto:blair at akamai.com]
Sent: 04 August 2000 01:14
To: orca-discuss at egroups.com
Subject: Re: [orca-discuss] number of columns does not match column
description (NOT)


If some of the lines in the file do not have the same number of
columns as the first line, then it will complain.  Please double
check that the /tmp/line file is the line of the file that Orca
complained about.  I'd be surprised if Orca has a bug here.

In any case, this isn't that large of an issue, except that some
data will not be plotted until the number of columns matches the
number of columns in the first line of the file.  This happens
when some new device or disk has been added or removed from the
system.  The longest that you'll have missing data in our output
plots is till the end of the current day.  The next day's data
will be properly loaded into Orca and plotted.

Blair

kevin at smolkowski.com wrote:
> 
> I am running orca-0.26 and Orcallator.se Version 1.25.  Orca
> is complaining that the number of columns does not match column
> description but this isnt true.
> 
> If I cut out the lines and compare them, the columns match,
> bash-2.03# wc -w /tmp/header
>      405 /tmp/header
> bash-2.03# wc -w /tmp/line
>      405 /tmp/line
> 
> The lines are pretty long as we have lots of disks.  Is this a known
> problem or should I start digging?
> 
> kevin at smolkowski.com
> 
> 




--------------------------------------------------------------------<e|-
Free, Unlimited Calls Anywhere!
Visit Firetalk.com - click below.
http://click.egroups.com/1/5479/12/_/576139/_/965382107/
--------------------------------------------------------------------|e>-





More information about the Orca-users mailing list