Hello, is It possible to create a dtrace script that is used a solaris system command. For example a script that will print the result of the uname -a command? Thx you if you could show me how to do that -- This message posted from opensolaris.org
Brendan Gregg - Sun Microsystems
2007-May-06 10:13 UTC
[dtrace-discuss] Dtrace / System Command
G''Day, On Sun, May 06, 2007 at 02:20:05AM -0700, dhizodfhazd wrote:> Hello, > is It possible to create a dtrace script that is used a solaris system command. > For example a script that will print the result of the uname -a command? > > Thx you if you could show me how to do thatIf you mean, run "uname -a" from DTrace, # dtrace -qwn ''BEGIN { system("uname -a"); exit(0); }'' SunOS laptop 5.10 Generic_118844-20 i86pc i386 i86pc but that isn''t needed in this case considering DTrace can fetch such details itself and without resorting to destructive mode (-w), # /opt/DTT/Bin/uname-a.d SunOS laptop 5.10 Generic_118844-20 i86pc i386 i86pc That script was from the DTraceToolkit, which contains, /* print system info */ dtrace:::BEGIN { printf("%s %s %s %s %s %s %s", `utsname.sysname, `utsname.nodename, `utsname.release, `utsname.version, `utsname.machine, `architecture, `platform); exit(0); } no worries, Brendan -- Brendan [CA, USA]