Getting Hardware Information in Solaris
Categories: Information Technology, System Administration, UNIXHere’s a quick way to find out what hardware is installed in your Solaris system, including RAM, CPUs, PCI cards, and external devices. The output will usually include the size of each memory chip in the system.
The one trick to using this command is to make sure you use the backtick instead of a single quote around the uname -i. The backtick is typically shift tilde and forces the command between the backticks to be executed and substituted in to that part of the command.
/usr/platform/`uname -i`/sbin/prtdiag
prtdiag actually displays system diagnostic information. I’ve used this on Solaris 7 through 10. The best parts is you do not even need to be root to execute this.
For more info on prtdiag check out the man page.
43 Responses to “Getting Hardware Information in Solaris”
-
shavenwarthog Says:
March 28th, 2006 at 6:52 pmwow that’s useful! thanks.
-
brad Says:
April 23rd, 2006 at 9:19 pmDamned useful! Love the “non root” part.
Cheers.
-
rm Says:
May 18th, 2006 at 10:04 amQuick and helpful. Thanks!
-
jose Says:
May 26th, 2006 at 7:54 pmprtdiag dont work in solaris i86pc, how is the equivalent?
-
Jon Says:
May 29th, 2006 at 3:45 pmJose, I’m afraid I don’t really know. I don’t even have Intel Solaris installed anywhere to check. Sorry. I’d say ask Sun support if you have a contract with them. Good luck.
Jon
-
Bib Says:
June 2nd, 2006 at 6:10 amHello .. Is there another equivalent command in Solaris of prtdiag? It’s not running in my system as I ma not logged in as root.
rgds
-
Jon Says:
June 3rd, 2006 at 3:18 pmBib, I don’t know of any other command that will give you all this info. You might want to ask your sys-admin about this. They may have disabled it for some reason.
Jon
-
jude Says:
July 3rd, 2006 at 5:17 pmUnder Solaris 10 (SPARC), the path to this is just:
/usr/sbin/prtdiag
-
Guru Prasad Says:
July 13th, 2006 at 4:00 amI exactly got the information, that i wanted. Thanks
-
Ajit Says:
July 21st, 2006 at 5:36 amI was trying with command
prtconfbut this is more userful for what I was trying to get. Thanks -
Joe Says:
September 11th, 2006 at 10:02 amThis is great information!
Thanks!
-
Franco Says:
September 13th, 2006 at 9:50 amHi,
This is usful, but was wondering if anbody knew how to get the serial number of the box by running a command from the cl ?
-
Jon Says:
September 13th, 2006 at 8:21 pmFanco,
It doesn’t sound like there’s any way to find the serial without physically going to the machine. It looks like there are some utilities which will store them on the system for you, but you still need to enter them from the case first.
If anyone does have a solution please post a response. If there’s a way I’d love to know how.
-
Emanuel Says:
September 14th, 2006 at 11:24 amIts work just fine on a SPARC Box, but I did not get any info on x86.
if some one can find any utill that can do it, I will more than happy.
thanks Jon. -
Jon Says:
September 19th, 2006 at 7:36 pmEmanuel,
I don’t think there is a counterpart on x86, but by the looks of this there will be soon:
http://blogs.sun.com/mws/entry/smbios_support_for_solaris_x86
-
Lee Says:
September 28th, 2006 at 2:47 pmJon,
I don’t have a Solaris box near me to check, but is the code reported by “hostid” different from the machine serial number?
-
Mike Smith Says:
September 29th, 2006 at 5:27 amprtdiag – good tip thanks
-
Mike Smith Says:
September 29th, 2006 at 5:29 amI found prtdiag ran fine without the path but would not using the published path
-
zumajim Says:
October 25th, 2006 at 1:18 amI agree with Mike Smith… prtdiag is in the default path already…
Now if I could just find an easy way to identify the SCSI adapter and disk I added to the system (Solaris 10 on x86 with IDE drive) to show up so I can add it to the file system…
-
Manohar Says:
November 15th, 2006 at 4:49 pmThat was very helpful!! Thanks!
-
Wes W Says:
December 8th, 2006 at 3:07 pmJust to confirm on Solaris x86, prtdiag is in the same location at /usr/sbin/prtdiag and runs find non-root.
-
arun ummatil joseph Says:
February 23rd, 2007 at 1:07 pmThats what I needed.. Thanks a lot.
-
Someone Says:
March 12th, 2007 at 3:30 pmThanks
-
vikrant Says:
April 3rd, 2007 at 10:45 amSuperb prima!!! could you explain the output as well?
-
Vinu Says:
April 18th, 2007 at 12:48 amThis is more useful for what I was trying to get… Thanks
-
Atreyee Says:
May 4th, 2007 at 4:42 amthanks !!! it solves the doubt instantly
-
stallman Says:
May 21st, 2007 at 9:17 pmIt’s helpful for me.
Thanks. -
Jevin Ramjattan Says:
May 24th, 2007 at 12:21 pmThis is insanely useful! It should have shown the hard drive size and info too, though.
-
Chris Noble Says:
June 6th, 2007 at 6:56 amYou get to see a Serial number of the box at bootup if you watch the output on a console. I don’t think this matches the Serial number seen on any physical label on the outside of the box.
I don’t know any other way to get the Serial number other than a reboot.
-
jen Says:
June 23rd, 2007 at 6:11 amTo see the serial number, you can use the eeprom command, most of the times it is registered in the banner var
# eeprom | grep banner
Regards
-
shrikant Says:
August 14th, 2007 at 6:51 pmHi,
# eeprom | grep banner doesnt give the serial number of the system! Is there any other command in sol-9?
Regards.
-
Tom Peacock Says:
October 30th, 2007 at 7:59 amI believe sneep is what your after….
-
Mike Shon Says:
November 19th, 2007 at 6:02 pmThe serial reported on a Sun in the boot banner is just the hostid in decimal and is not related to the actual chassis serial number (CSN)
On older Sun platforms, the only source for the CSN is the tag on the chassis or the “yellow sheet” that ships with the box.
To make it software-accessible, you might want to use sneep , as was mentioned already.
Sneep can also store and protect almost any other platform-specific data that you might need, like Asset tag or contact information.Many of the newer platforms include some kind of built-in CSN support, but Sun is still (as of 11/2007) working on a standard way to get at it; some use prtdiag, some use SMBIOS or IPMI or FRUID, some put it in the LOM or ILOM or other System Controller.
Sneep 1.79 knows how to get at some of these, and future updates will try to improve on this and track the upcoming standard as it gets defined and implemented.
As of 11/2007, the sneep download at http://www.sun.com/download/products.xml?id=4304155a is 1.76
and it doesn’t know anything that you haven’t told it
(unless sneep can find the serial in your explorer or CST configuration)If you have to have 1.79 (which also fixes a problem with eeprom handling by Veritas vxfs 4.1 and above), make a request on sneep-support@sun.com
Right now the best solution is to use sneep and to tell it your serial number once. Sneep will put it in the eeprom (on SPARC) protect it from loss or damage.
It does the best it can on x86, but there is no true eeprom.
At least you have a simple, standard way to get the serial back . -
Kaleem Says:
December 3rd, 2007 at 6:00 amthanx a lot, very useful command i.e wat i required.
-
Carlos Says:
January 4th, 2008 at 11:04 amUseful, very useful, thanks
-
lol24h Says:
January 21st, 2008 at 8:00 pm“non root” part roxx, THX very much !
-
Mitesh Says:
April 14th, 2008 at 11:34 amSuper.. to find serial name, can’t you just do $hostid
-
Michael Shon Says:
May 7th, 2008 at 10:49 amAs of 5/2008, Sneep has been updated and now can find the serial number on many Solaris platforms, including x86 .
On x86 is uses smbios and ipmi to look for the serial, as you can too.
Sneep 1.92 (and beyond) should be available from
http://www.sun.com/sneep -
Jacques Says:
May 14th, 2008 at 5:52 amIf you run a explorer, then you will find your serial number in the
/opt/SUNWexplo/output/explorer.`hostid`.`hostname`…./README file (System Serial number)Have a nice day.
-
mitashki Says:
July 4th, 2008 at 4:40 amQuite handy!
Thx -
CC Says:
August 18th, 2008 at 7:57 pmJacques – you will only find the Serial number in the README if you have provided it as a result of the installation questionnaire. Info found in the /opt/SUNWexplo/output/explorer.`hostid`.`hostname`…./defaults file.
-
UK Says:
February 18th, 2009 at 10:53 amExcellent!
Thanks for the command. -
Ezee Admin Says:
April 30th, 2009 at 5:53 pmVery useful.
Thanks

