Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Monday February 03, 2003
10:52 AM

prtdiag - new (for me) solaris command

[ #10363 ]
In my quest to get cpu info on solaris, I came across the command "prtdiag". Most solaris boxes have it (I think), though it's probably not in your path. Check /usr/platform/<system>/sbin, where <system> is the current system type (probably "sun4u" these days, but double check).

Anyway, it provides a lot more information than ye ol' sys/processor.h file does, including cpu temperature and exact type, plus some other goodies. I'm now searching for the source for prtdiag to see if I can wrap it. :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by hfb (74) on 2003.02.03 12:04 (#16661) Homepage Journal

    If you have solaris 9, try kstat. Solaris 8 has kstat too but you'll need to get the kstat module off of CPAN.

    • Is prtdiag just another subset of kstat? I wasn't sure. I didn't see anything for getting the cpu temp, for example, although the man page doesn't strike me as complete.

      I downloaded Solaris::Kstat but it's only good for 2.5, 2.6 and 2.7 (so it says). At least that tells me I need to watch out for using kstat functions that aren't in older versions of solaris. I'm sure I'll be able to get some ideas from it, although the documentation is a bit lacking IMHO.

      Hopefully, Sun will provide smaller libs in

      • ah, right...kstat, the command utility is in 8 as well. The library is pretty much the same across 2.5->9 but the kstat utility, which is perl I might add, is in 8 and up. I didn't think prtdiag had the environmental output before solaris 8 or with earlier sun4u boxes. envctrl_temp is the kstat instance that you want but I'm not sure if the kstat utility will grab that or not...though, since it's perl, you can probably make it do what you need.