013-linux系統管理——系統資源查看

linux系統管理——系統資源查看

############# vmstat 命令 監控系統資源 #############

vmstat [刷新時間 刷新次數]


[root@zabbix ~]# vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0      0 3321084   2108 243580    0    0    23    43  124  159  1  2 97  0  0
 0  0      0 3321084   2108 243580    0    0     0   115  181  230  0  2 98  0  0
 0  0      0 3321084   2108 243580    0    0     0     4  163  251  1  0 99  0  0




########### dmesg 開機時內核檢測的信息 ################

[root@zabbix ~]# dmesg 

[root@zabbix ~]# dmesg | grep CPU
[    0.000000] smpboot: Allowing 128 CPUs, 126 hotplug CPUs
[    0.000000] setup_percpu: NR_CPUS:5120 nr_cpumask_bits:128 nr_cpu_ids:128 nr_node_ids:1
[    0.000000] PERCPU: Embedded 38 pages/cpu @ffff9827f9600000 s118784 r8192 d28672 u262144
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=128, Nodes=1
[    0.000000]     RCU restricting CPUs from NR_CPUS=5120 to nr_cpu_ids=128.
[    3.374277] mce: CPU supports 8 MCE banks
[    3.376148] MDS: Vulnerable: Clear CPU buffers attempted, no microcode
[    3.709685] smpboot: CPU0: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz (fam: 06, model: 2a, stepping: 07)
[    3.710231] core: CPUID marked event: 'cpu cycles' unavailable
[    3.710237] core: CPUID marked event: 'instructions' unavailable
[    3.710243] core: CPUID marked event: 'bus cycles' unavailable
[    3.710247] core: CPUID marked event: 'cache references' unavailable
[    3.710252] core: CPUID marked event: 'cache misses' unavailable
[    3.710256] core: CPUID marked event: 'branch instructions' unavailable
[    3.710261] core: CPUID marked event: 'branch misses' unavailable
[    3.796324] smpboot: CPU 1 Converting physical 2 to logical package 1
[    3.796731] Brought up 2 CPUs


[root@zabbix ~]# cat /proc/cpuinfo| grep "physical id" | sort| uniq| wc -l
      uniq 命令用於檢查及刪除文本文件中重複出現的行列,通常與 sort 命令結合使用 [root@zabbix
~]# cat /proc/cpuinfo| grep "cpu cores"| uniq ########### free 命令 ##################### [root@zabbix ~]# free -h total used free shared buff/cache available Mem: 3.7G 287M 3.2G 12M 240M 3.1G Swap: 2.0G 0B 2.0G 緩衝/緩存: 緩存和緩存的區別: 緩存(cache)是用來加速數據從硬盤中 」讀取「 的,而緩衝(buffer)是用來加速數據 」寫入「 硬盤的 ########### 查看系統與內核相關信息 ##################### [root@zabbix ~]# uname -a 查看系統全部相關的信息 -r 查看內核版本 -s 查看內核名稱 ########### 查詢當前Linux系統的發行版本 ###### [root@zabbix ~]# lsb_release -a -bash: lsb_release: 未找到命令 [root@zabbix ~]# cat /etc/centos-release CentOS Linux release 7.6.1810 (Core) [root@zabbix ~]# cat /etc/issue \S Kernel \r on an \m ########## 判斷當前系統的位數 ######## [root@zabbix ~]# file /bin/ls /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ceaf496f3aec08afced234f4f36330d3d13a657b, stripped ########### 列出進程打開或使用的文件信息 ######## [root@zabbix ~]# lsof #列出進程調用或打開的文件信息 -c 字符串: 只列出以字符串開頭的進程打開文件 -u 用戶名: 只列出某個用戶的進程打開的文件 -p pid: 列出某個PID進程打開的文件
相關文章
相關標籤/搜索