9

I want to know what is command which will show me servers hardware [through ssh access], like how much Gb RAM is installed, cpu speed, and so on.

Thank You.

9 Answers 9

10

quick and dirty way:

cat /proc/meminfo

cat /proc/cpuinfo

13
lshw

I have found lshw to be an invaluable resource in gathering hardware information that is otherwise difficult to gather without cracking the servers case (BIOS version, Motherboard model number, which slots of RAM are populated, etc)

A good writeup/overview of lshw can be found here

1
  • Always good to find out about commands that I'd never heard of +1 for teaching me something new. Mar 8, 2010 at 14:44
3
1

More specific information about hardware may be given by a dmidecode command.

1

Can do that Ansible if you have Python2 and SSH access on a remote machine.

ansible -m setup ${hostname}

This will output a nice JSON which includes CPU/RAM/HDD/Network and software configuration. Read the documentation for more information.

1

To get Hardware Info,

dmidecode -t system

1

Try hw-probe tool. It collects meminfo, cpuinfo, hwinfo, lspci, lsusb, smartctl and many other logs in one place and provides free hosting for your probes on the https://linux-hardware.org/ web site.

Probe example for Dell PowerEdge R710: https://linux-hardware.org/?probe=186f3c15dd

You can find similar hardware models and configurations in the database to compare and properly setup your system.

enter image description here

I'm the author of this project, feel free to ask any questions in comments.

0

Try the following commands:

free -m
cat /proc/cpuinfo  | grep -E "(model name|cpu MHz)"
lspci
less /var/log/dmesg (or just exec dmesg)

This will first show you the amount of RAM (in MB) installed in your system. Then the CPU Name and speed - it will output it for each (virtual)core. lspci lists all PCI devices and the dmesg log shows you all kernel messages which include initialization of hardware.

That should cover about everything they build into your system.

0

Add these aliases to your bash for fast and detailed info

alias serverinfo="sudo lshw | head -n 23"
alias cpuinfo="sudo lscpu"
alias meminfo="sudo lshw | egrep -v 'resources|UNCLAIMED' | grep -A 25 memory"
alias diskinfo="sudo lshw | grep -A 100 '*-scsi'"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .