三三世界-百宝箱

文章 分类 标签
130 9 247

公告

暂无站点公告

Linux CentOS 查看服务器硬件配置信息命令合集

三三 2021-11-03 2624 0条评论 服务器配置Linux使用 linux centos查看服务器硬件硬件配置信息命令合集

首页 / 正文

服务器收到以后需要查看相关硬件和配置信息,那么需要用到下面的常用命令,参考如下:

首先列几个比较使用的命令。

lscpu   //列出cpu

Architecture: i686 #架构686
CPU(s): 12 #逻辑cpu
Thread(s) per core: 1 #每个核心线程数
Core(s) per socket: 6 #每个物理cpu核数
CPU socket(s): 2 #cpu插槽数
Vendor ID: GenuineIntel #cpu厂商ID是GenuineIntel
CPU family: 6 #cpu系列是6
Model: 23 #型号23
model name: Intel(R) microprocessor C4004 @ 740KHz
Stepping: 10 #步进是10
CPU MHz: 800.000 #cpu主频是800MHz
Virtualization: VT-x #cpu支持的虚拟化技术VT-x
L1d cache: 32K #一级缓存32K(google了下,这具体表示表示cpu的L1数据缓存为32k)
L1i cache: 32K #一级缓存32K(具体为L1指令缓存为32K)
L2 cache: 3072K #二级缓存3072K

lsscsi -l   //列出scsi设备信息
yum install lsscsi -y  //如果上面命令不好用,安装一下

lspci    //查看当前PCI总线设备信息
lsblk    //列出查看磁盘块设备信息
lsmem    //列出内存情况
lsusb    //列出usb设备

一、查看CPU的信息

1、用cat打开查看

cat /proc/cpuinfo  //查看CPU 的详细信息 (型号, 家族, 缓存大小等)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c  //查看CPU型号
cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l   //查看物理CPU的个数
cat /proc/cpuinfo |grep "processor"|wc -l  //查看逻辑CPU的个数
cat /proc/cpuinfo |grep MHz|uniq  //查看CPU的主频
lscpu //查看cpu的相关信息

2、CPU负载信息 - 利用文件查看(CPU繁忙处理任务过多)

cat /proc/loadavg

二、查看内存信息
1、利用文件查看内存信息

cat /proc/meminfo

2、输入命令“free -m”查看内存信息

三、查看磁盘信息
1、利用文件查看

cat /proc/mounts  //查看系统详细的挂载信息

2、命令查看

df -h 查看磁盘使用情况
fdisk -l |grep Disk 查看磁盘分区情况
lsblk  查看硬盘和分区分布
fdisk -l  查看硬盘和分区的详细信息

3、查看所有交换分区

swapon -s

4、使用smartctl命令查看 注意:该命令需要安装smartmontools工具。

yum install smartmontools    //安装工具
smartctl --all /dev/sda     //这里的Vendor和Product实际上是磁盘阵列卡的信息,而不是磁盘信息。
smartctl -a -d sat+megaraid,0 /dev/sda   
smartctl --all /dev/sda -d megaraid,1
smartctl -i /dev/sda   //查看硬盘信息
smartctl -H /dev/sda    // 查看硬盘的SMART健康 PASSED表示没问题
smartctl -A /dev/sda    //查看原厂信息

如果做了软RAID可以试试:

cat /proc/mdstat

如果无效,可以使用下面的命令。

lsscsi -g
dmesg | grep ATA
dmidecode|more 服务器品牌
smartctl -i -d cciss,0 /dev/sda

 1 Raw_Read_Error_Rate     读取错误率
  3 Spin_Up_Time            起转时间
  4 Start_Stop_Count        启动停止次数
  5 Reallocated_Sector_Ct   重新分配扇区计数
  7 Seek_Error_Rate         寻道错误率
  9 Power_On_Hours          通电时间
 10 Spin_Retry_Count        起转重试次数
 11 Calibration_Retry_Count 重新校准重试次数
 12 Power_Cycle_Count       启动<->关闭循环次数
192 Power-Off_Retract_Count 断电磁头缩回计数
193 Load_Cycle_Count        磁头加载/卸载循环计数
194 Temperature_Celsius     温度
196 Reallocated_Event_Count 在分配扇区物理位置事件计数(与坏道无关)
197 Current_Pending_Sector  当前等待中扇区数(状态存疑/不稳定-等待后续判断)
198 Offline_Uncorrectable   无法修正的扇区总数
199 UDMA_CRC_Error_Count    UltraDMA CRC错误计数
200 Multi_Zone_Error_Rate   写入错误率

这里的Device Model右侧的信息就是硬盘的具体型号,User Capacity右侧的信息就是硬盘的实际大小

四、查看网卡信息
1、命令查看IP和网卡信息

ifconfig   //centos6查看
ip addr    //centos7查看

2、查看网卡硬件信息

lspci|grep Ethernet

如果没安装lspci,使用命令:

yum whatprovides */lspci

如果得到类似信息:

pciutils-3.5.1-3.el7.x86_64 : PCI bus related utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/lspci

继续输入命令:

yum install pciutils -y

再次执行刚才的命令即可:lspci|grep Ethernet

五、带宽信息查看

1、查看网络整体情况,带宽,端口等。

ethtool eth0(网卡名)

2、查看路由表

route -n 

3、查看所有监听端口

netstat -ntpl

4、查看某端口使用情况

lsof -i

六、查看主板信息

dmidecode |grep -A16 "System Information$"     //查看主板型号

七、查看BIOS信息

dmidecode -t bios   //查看BIOS相关信息

八、查看环境变量

env

九、查看所有进程和用户信息

ps -ef

1、可以通过ps -ef | grep 进程名 进行过滤

ps -aux 可以看到进程占用CPU,内存情况
ps -aux 

2、实时显示进程状态

top

3、查看活动用户

w  或者 who

4、查看指定用户的信息

id root   //root可以换成其他用户

5、查看用户登录日志

last 

6、查看系统所有用户

cut -d: -f1 /etc/passwd

评论(0)

当前没有评论,还不快来留下第一个脚印吧


Copyright 2021 三三世界-百宝箱. All Rights Reserved.

最新评论

  • 三三

    @Doug Shume it's ok for me , you can post here.

  • refugiaguenther

    Saved as a favorite, I like your website!

  • josefa

    If some one wishes to be updated with hottest technologies after that he must be visit this site and be up to date daily.

  • Penzu

    Heello would you mind sharing which blog platform you're using? I'm planning to start my own blog in the near future but I'm having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then moost blogs and I'm looking for something completely unique. P.S Apologies forr being off-topic butt I had to ask!

  • Yupoo Fendi

    Thanks to my father who shared with me regarding this webpage, this website is genuinely amazing.

  • Doug Shume

    Hi, I have an overflow of customers that I'd like to send to you but I want to make sure you can handle more leads, let me know if you'd like me to send you more info.

  • SuperWind

    zh.us.to 有效
    kms.03k.org 有效
    kms.chinancce.com
    kms.shuax.com 有效
    kms.dwhd.org 有效
    kms.luody.info 有效
    kms.digiboy.ir 有效
    kms.lotro.cc 有效
    www.zgbs.cc 有效
    cy2617.jios.org 有效

  • 三三

    @         权限问题,试试sudo 再加命令。

  •         

    你好提示Permission denied 怎么办啊

日历

2024年05月

   1234
567891011
12131415161718
19202122232425
262728293031 

文章目录

上一张 下一张