Hello Everyone, I''m trying to forward the output from Dtrace to a database, and I don''t think there is a connector do this. I attemp to used a Java program to run my Dtrace program, by using the .exec() method, and then tried to process the output from the running Dtrace program. The problem is that the Java Program cann''t catch the output from the Dtrace program, because the Dtrace program only output something once a while. Does anybody have other aproaches or ideas? Thanks in advance for any help. This message posted from opensolaris.org
Sébastien Bouchex Bellomié
2007-Feb-09 07:38 UTC
[dtrace-discuss] Re: forward output from Dtrace to database
Hi, Why not using the Dtrace Java API that comes with opensolaris ? This API allows you to run script from Java, to retreive the result. Then you can do what you want... Seb This message posted from opensolaris.org
Adam Leventhal
2007-Feb-10 13:47 UTC
[dtrace-discuss] forward output from Dtrace to database
Hi Jack, DTrace has an undocumented freopen() action that redirects its output to a given file, and the documented system() action that can invoke arbitrary commands. Would it be possible to have a script that dumps its output to a temporary file and then invokes some command or script that forwards that output to your database? Adam On Thu, Feb 08, 2007 at 10:35:13PM -0800, jack wrote:> Hello Everyone, > > I''m trying to forward the output from Dtrace to a database, and I don''t think there is a connector do this. > > I attemp to used a Java program to run my Dtrace program, by using the .exec() method, and then tried to process the output from the running Dtrace program. > > The problem is that the Java Program cann''t catch the output from the Dtrace program, because the Dtrace program only output something once a while. > > Does anybody have other aproaches or ideas? Thanks in advance for any help. > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Hi, can you tell me tell me more deital how freopen() works plealse? This is what I''m thanking about "freopen()": I''m thinking when a probe got fire, I can print out message inside the function and then I can forward these message to a file? Thanks. This message posted from opensolaris.org
Adam Leventhal
2007-Feb-12 06:13 UTC
[dtrace-discuss] Re: forward output from Dtrace to database
Hi Jack, The freopen() action causes output from subsequent actions (e.g. trace() or printf()) to go to the given file. ---8<--- reopen.d ---8<--- #pragma D option quiet #pragma D option destructive BEGIN { trace("howdy\n"); freopen("foo"); trace("this is in file foo\n"); freopen("bar"); trace("this is in file bar\n"); exit(0); } ---8<--- reopen.d ---8<--- # dtrace -s reopen.d howdy # cat foo this is in file foo # cat bar this is in file bar Enjoy. Adam On Sun, Feb 11, 2007 at 09:29:33PM -0800, jack wrote:> Hi, can you tell me tell me more deital how freopen() works plealse? > > This is what I''m thanking about "freopen()": > > I''m thinking when a probe got fire, I can print out message inside the function > and then I can forward these message to a file? > > Thanks. > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Hi, I searched the internet for installation of Dtrace Java API, but I can''t reach anything official or I can follow, because my Solaris doesn''t have Dtrace Java API installed. I would like to know the office site of Dtrace Java API, or some sites that I can follow some instruction to install the API. Thanks. This message posted from opensolaris.org