I wanted to put a note here for myself, and for others who are looking for a way to get information about a particular executable running in a zone on their machine. While it is (to the best of my knowledge) not possible to do this from within the local zone itself, you can run dtrace from the global zone and specify the zone name and executable by using a logical AND in the predicate, like this:

dtrace -n ’syscall:::entry /zonename == “webserver” && execname == “httpd”/{ printf(”%S”, curpsinfo->pr_psargs); trace(pid) }’

This is a command I used to get some quick information about all of the httpd processes running on a web server that exists as a zone on a solaris 10 machine. Here’s some output:

0 6485 write:entry /var/local/httpd/bin/httpd -DSSL\0 12248
0 6779 llseek:entry /var/local/httpd/bin/httpd -DSSL\0 12248
0 6489 close:entry /var/local/httpd/bin/httpd -DSSL\0 12248
0 6789 pollsys:entry /var/local/httpd/bin/httpd -DSSL\0 12248

The command is run from the global zone. This isn’t exactly what I wanted — I wanted all of the arguments passed to all of the system calls, but I got the arguments passed to the httpd process itself at start time instead. I’m still chugging through the documentation, so if I find more cool stuff, I’ll put it here. Meanwhile, if you know how to do what I’m trying to do, or how to do some other cool stuff with DTrace, please share!!

Here are a few links about DTrace that I’m using to get more information. It’s plenty to get you started, but not a lot of info on how to do anything remotely advanced. Even coverage of ‘advanced’ features is pretty dumbed down compared to the crazy stuff I’m seeing in some of the example scripts. Nonetheless, this stuff *is* useful:

http://www.snpnet.com/sun_DTrace/dtrace.html
http://users.tpg.com.au/adsln4yb/dtrace.html
http://www.sun.com/bigadmin/content/dtrace/
http://blogs.sun.com/bmc