wessels at measurement-factory.com
Tue Jun 3 14:41:51 UTC 2008
On Mon, 2 Jun 2008, A00612438 at itesm.mx wrote:
> I want to be able to send by email the datasets found in the collector module
> of the DSC, but i'm having trouble finding the datasets in the source code.
> The idea is to send the datasets before they are dumped from memory to the
> xml files. I'm trying to make a library in C for this, could you please point
> out in which part of the code the dumping of the datasets is done? Thank
> you very much!
creation of dataset files starts in function dump_reports() in
collector/dsc/daemon.c. Here a temporary file is opened (see
mkstemp() and fdopen()).
Then dns_message_report() and ip_message_report() are called.
dns_message_report() calls md_array_print() with an argument
&xml_printer, which is of type md_array_printer. This will generate
the XML output. You could create a different md_array_printer that
creates a different output file format (plain text, binary, etc).
If you want to send the XML data via email instead of just writing it
to disk then you could replace mkstemp() and fdopen() with a popen()
More information about the dsc