is there a standard command for Linux that would provide a description of the server? (Things like model, number of cores, speed...)
7 Answers
Ubuntu provides lshw in ubuntu-standard
, it will be on any distribution ending with "untu". Many other distributions have their own tools, a lot of it can be found in /proc
. You can find the man page for lshw here
dmesg shows load of your hardware too.
-
5If your machine has been up for a while dmesg may no longer have the boot messages. If that's a case look for a /var/log/dmesg.boot file which will have the boot messages.– voretaq7Jan 28, 2010 at 16:21
cat /proc/cpuinfo = CPU information
lspci = Shows PCI card Hardware name
uname -a = Shows kernel version, architecture & build date/host
cat /proc/meminfo = memory (wired + vm) info
These have worked on every linux system i've seen. lspci
is part of the pciutils
package, and relies on a database of PCI id's. The stuff in /proc would only be the pci id's)
"dmidecode" is present in all linux distribution and usually enough, to find most relevant parts together with serialnumbers.
The standard tool in Debian and Suse however is "hwinfo". It is a very comprehensive DeviceInfo-tool, and I wish (based on habbits) it would be standard accross all distributions.
For a short Overview you type
hwinfo --short
You can combine --short with specific devices like --cpu and --disk.
hwinfo --short --cpu --disk
For everything you simply type
hwinfo
Or specific to a devicetype:
hwinfo --netcard
you get a complete list of features with
hwinfo --help
In addition "smartctl --all" shows special informations about harddrives, not shown in any other tool.
Puppet facter from PuppetLabs provides an interface to identify hardware on a system. facter
can work without Puppet itself, can be extended to gather your own facts, and runs on many Operating Systems.
I'm using facter
, along with Puppet and The Foreman as a Puppet ENC to keep track of hardware. Facter provides a frontend to disparate tools like dmidecode
, cat /proc/cpuinfo,
MAC=ifconfig en0 |grep ether |cut -f2 -d" "
, and then information is all presented in a neat, orderly format. I've used it on RHEL, Ubuntu, Mac OS X, FreeBSD & Solaris-- gathering this information on my own was maddening. Puppet facter
does much of the work for you.
-
-
GNU/Linux doesn't provide a single, unified "standard command" to describe a server.
facter
is one of the most commonly used alternatives, however. Jan 23, 2015 at 0:13 -
dmidecode comes close, and it is included in all of the distributions Jan 23, 2015 at 0:15