From A00612438 at itesm.mx Mon Jun 2 22:31:13 2008 From: A00612438 at itesm.mx (A00612438 at itesm.mx) Date: Mon, 2 Jun 2008 17:31:13 -0500 Subject: [dsc] Datasets Message-ID: <4842877200001106@mailserver1.itesm.mx> Hello, 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! From wessels at measurement-factory.com Tue Jun 3 14:41:51 2008 From: wessels at measurement-factory.com (Duane Wessels) Date: Tue, 3 Jun 2008 08:41:51 -0600 (MDT) Subject: [dsc] Datasets In-Reply-To: <4842877200001106@mailserver1.itesm.mx> References: <4842877200001106@mailserver1.itesm.mx> Message-ID: <20080603083525.G72056@measurement-factory.com> On Mon, 2 Jun 2008, A00612438 at itesm.mx wrote: > Hello, > > 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() call. Duane W.