Argus Printf Statement
Russell Fulton
r.fulton at auckland.ac.nz
Mon Jul 17 01:36:03 EDT 2000
FIrstly sorry for the silence when this first came up -- I have been
off the net for a few days....
On Wed, 12 Jul 2000 08:03:15 -0400 Carter Bullard <carter at qosient.com>
wrote:
>
> This I believe would be a huge thing to do, and I would like to
> get some opinions on how this could work. Now I don't have any
> Perl experience, so all my examples will be C oriented.
>
> I can see providing an argprintf() function that mimics sprintf():
>
> argprintf((char *)buf, (char *)formatstr, (ArgusStruct *) arg)
>
> and the formatstr can have a syntax very much like printf() and
> strftime(). A first thought, we could come up with a syntax
> that allows us to extend the normal printf() and strftime()
> formats with Argus data identifer tags. This would allow a
> preprocessor to be able to construct real sprintf() and
> strftime() calls based on our syntax.
>
> We've got to be able to specify source vs. destination for metrics
> and flow identifiers, so a %s.X and a %d.Y type of qualifier may
> be all that is needed. For time we've got start and stop time
> values and their formats to consider.
Yep, that basically what I had in mind. In particular I wanted to be
able to supply the format string to whatever replaces ra...
That said, I could live with the simple delimited lists output that
others have suggested. One point though is how do we get at data which
isnt in the default displays? eg. time to live
One motivation for specifying the formatting is that formatting seems
to be a major part of the cpu overhead of ra. (i.e. ra spends a lot of
time formatting output records) So I thought that it might spead it up
by only getting the data formatted that I wanted. This isnt a very big
deal though and may not be worth the effort.
As for what delimiter to use I prefer tabs since they won't occur in
any legitimate data. '-' are used in the current default format for
the reset/direction symbols. That said I really don't care so long as
we can be sure it won't someday pop up in a data field.
Cheers, Russell
More information about the argus
mailing list