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.

Shishant
  • 683
  • 2
  • 8
  • 13

9 Answers9

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

faultyserver
  • 1,914
  • 1
  • 16
  • 20
10

quick and dirty way:

cat /proc/meminfo

cat /proc/cpuinfo

Mark Regensberg
  • 1,411
  • 12
  • 14
3
Zoredache
  • 130,897
  • 41
  • 276
  • 420
1

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

Jacek Konieczny
  • 3,777
  • 2
  • 23
  • 22
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.

ypid
  • 171
  • 1
  • 4
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.

linuxbuild
  • 201
  • 1
  • 7
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'"
itchap
  • 1
  • 2
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.

Lukas Loesche
  • 960
  • 1
  • 7
  • 11