[CentOS 7系列]监控系统状态

1、w/uptime 查看系统负载

[root@server01~]#w##分别为1分钟,5分钟,15分钟的负载
17:35:58up5:30,1user,loadaverage:0.00,0.01,0.05
USERTTYFROMLOGIN@IDLEJCPUPCPUWHAT
rootpts/0gateway17:326.00s0.26s0.12sw
[root@server01~]#uptime
17:36:02up5:30,0.05


2、/proc/cpuinfo 查看cpu核数

[root@server01~]#cat/proc/cpuinfo
processor:0##表示只有1个逻辑cpu
vendor_id:GenuineIntel
cpufamily:6
model:58
modelname:Intel(R)Core(TM)i5-3230MCPU@2.60GHz
stepping:9
microcode:0x1b
cpuMHz:2593.839
cachesize:3072KB
physicalid:0
siblings:1
coreid:0
cpucores:1
apicid:0
initialapicid:0
fpu:yes
fpu_exception:yes
cpuidlevel:13
wp:yes
flags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsmmxfxsrssesse2sssyscallnxrdtscplmconstant_tscarch_perfmonpebsbtsnoplxtopologytsc_reliablenonstop_tscaperfmperfeagerfpupnipclmulqdqssse3cx16pcidsse4_1sse4_2x2apicpopcntxsaveavxf16crdrandhypervisorlahf_lmidaaratepbplnptsdthermfsgsbasesmepxsaveopt
bogomips:5188.23
clflushsize:64
cache_alignment:64
addresssizes:40bitsphysical,48bitsvirtual
powermanagement:


3、vmstat 监控系统状态

[root@server01~]#vmstat
procs-----------memory-------------swap-------io-----system--------cpu-----
rbswpdfreebuffcachesisobiboincsussyidwast
200749284876150960006115180010000
[root@server01~]#vmstat15##1秒显示1次,一共显示5次
procs-----------memory-------------swap-------io-----system--------cpu-----
rbswpdfreebuffcachesisobiboincsussyidwast
200749284876150960006115180010000
000749268876150960000020230010000
00074926887615096000001614019900
000749268876150960000022250010000
000749268876150960000019140010000

�参数解读:

r run,运行中的进程数

b block,卡死状态

swpd swap中的进程数(影响si,so)

si 有多少kb的数据从swap进入内存中

so 有多少kb的数据从内存中进入swap中

bi 从磁盘出来进入内存,读

bo 从内存出来进入磁盘,写

us 用户占用资源百分比(us + sy + id =100)

wa wait,等待cpu的进程百分比

4、top 查看进程使用资源情况

[root@server01~]#top##动态显示,3秒1次
top-17:57:23up5:51,0.05
Tasks:82total,2running,80sleeping,0stopped,0zombie
%Cpu(s):0.3us,0.0sy,0.0ni,99.7id,0.0wa,0.0hi,0.0si,0.0st
KiBMem:1008392total,748360free,107540used,152492buff/cache
KiBSwap:2097148total,2097148free,0used.735044availMem
#RES表示物理内存大小#
PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND
3root200000S0.30.00:00.07ksoftirqd/0
21root200000S0.30.00:17.59kworker/0:1
1root20012809267083952S0.00.70:01.87systemd
2root200000S0.00.00:00.01kthreadd
......
[root@server01~]#top-c##显示详细的进程信息
top-17:59:12up5:53,0.05
Tasks:83total,1running,82sleeping,0zombie
%Cpu(s):0.0us,100.0id,748164free,107680used,152548buff/cache
KiBSwap:2097148total,0used.734864availMem

PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND
21root200000S0.30.00:17.73[kworker/0:1]
2619root20015760422041608R0.30.20:00.01top-c
......
[root@server01~]#top-bn1##静态显示
top-18:00:22up5:54,0.1sy,99.8id,748316free,107528used,0used.735016availMem

PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND
1root20012809267083952S0.00.70:01.87systemd
2root200000S0.00.00:00.01kthreadd
3root200000S0.00.00:00.07ksoftirqd/0
6root200000S0.00.00:00.36kworker/u128:0
......

q退出,1显示所有核cpu。

默认按cpu排序,M按内存使用排序,P按cpu使用排序。


5、sar 系统活动情况

[root@server01~]#yuminstall-ysysstat
......
已安装:
sysstat.x86_640:10.1.5-11.el7

作为依赖被安装:
lm_sensors-libs.x86_640:3.4.0-4.20160601gitf9185e5.el7

完毕!
[root@server01~]#sar-nDEV##网卡流量
Linux3.10.0-514.el7.x86_64(server01)2017年07月10日_x86_64_(1CPU)

18时10分02秒IFACErxpck/stxpck/srxkB/stxkB/srxcmp/stxcmp/srxmcst/s
18时20分01秒lo0.000.000.000.000.000.000.00
18时20分01秒ens330.180.110.020.010.000.000.00
平均时间:lo0.000.000.000.000.000.000.00
平均时间:ens330.180.110.020.010.000.000.00

23时01分06秒LINUXRESTART
[root@server01~]#sar-nDEV13##每隔1秒显示一次,一共显示3次
Linux3.10.0-514.el7.x86_64(server01)2017年07月10日_x86_64_(1CPU)

23时06分46秒IFACErxpck/stxpck/srxkB/stxkB/srxcmp/stxcmp/srxmcst/s
23时06分47秒lo0.000.000.000.000.000.000.00
23时06分47秒ens331.011.010.060.180.000.000.00

23时06分47秒IFACErxpck/stxpck/srxkB/stxkB/srxcmp/stxcmp/srxmcst/s
23时06分48秒lo0.000.000.000.000.000.000.00
23时06分48秒ens331.011.010.060.400.000.000.00

23时06分48秒IFACErxpck/stxpck/srxkB/stxkB/srxcmp/stxcmp/srxmcst/s
23时06分49秒lo0.000.000.000.000.000.000.00
23时06分49秒ens331.001.000.060.400.000.000.00

平均时间:IFACErxpck/stxpck/srxkB/stxkB/srxcmp/stxcmp/srxmcst/s
平均时间:lo0.000.000.000.000.000.000.00
平均时间:ens331.011.010.060.330.000.000.00
[root@server01~]#sar-q##系统负载
Linux3.10.0-514.el7.x86_64(server01)2017年07月10日_x86_64_(1CPU)

18时10分02秒runq-szplist-szldavg-1ldavg-5ldavg-15blocked
18时20分01秒11000.000.010.050
平均时间:11000.000.010.050

23时01分06秒LINUXRESTART
[root@server01~]#sar-b##磁盘读写
Linux3.10.0-514.el7.x86_64(server01)2017年07月10日_x86_64_(1CPU)

18时10分02秒tpsrtpswtpsbread/sbwrtn/s
18时20分01秒0.070.000.070.000.86
平均时间:0.070.000.070.000.86

23时01分06秒LINUXRESTART
[root@server01~]#sar-f/var/log/sa/sa10##历史文件,每10分钟保存一次
Linux3.10.0-514.el7.x86_64(server01)2017年07月10日_x86_64_(1CPU)

18时10分02秒CPU%user%nice%system%iowait%steal%idle
18时20分01秒all0.010.000.090.000.0099.90
平均时间:all0.010.000.090.000.0099.90

23时01分06秒LINUXRESTART
[root@server01~]#


6、nload实时网络流量

[root@server01~]#yuminstall-ynload
已安装:
nload.x86_640:0.7.4-4.el7

完毕!
[root@server01~]#nload##通过左右方向键切换网卡
Deviceens33[192.168.137.100](1/2):
=================================================================
Incoming:
......
Outgoing:
#############################################Curr:78.50MBit/s
#############################################Avg:16.47MBit/s
#############################################Min:4.13kBit/s
#############################################Max:98.17MBit/s
#############################################Ttl:318.58MByte

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


linux下开机自启: 在/etc/init.d目录下新建文件elasticsearch 并敲入shell脚本: 注意, 前两行必须填写,且要注释掉。 第一行为shell前行代码,目的告诉系统使用shell。 第二行分别代表运行级别、启动优先权、关闭优先权,且后面添加开机服务会用到。 shell脚本
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod +x /etc/rc.d/rc.local 2、赋予脚本可执行权限假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限 chmod +x /usr
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用ls -ll,会显示成字节大小,而ls- lh会以KB、MB等为单位进行显示,这样比较直观一些。 通过命令du -h –max-depth=1 *,可以查看当前目录下各文件、文件夹的大小,这个比较实用。 查询当前目录总大小可以使用d
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一但shell关闭网站也就关闭了,所以要配置守护进程, 用的是Supervisor,本文主要记录配置的过程和过程遇到的问题 安装Supervisor 1 yum install python-setuptools
设置时区(CentOS 7) 先执行命令timedatectl status|grep 'Time zone'查看当前时区,如果不是时区(Asia/Shanghai),则需要先设置为中国时区,否则时区不同会存在时差。 #已经是Asia/Shanghai,则无需设置 [root@xia
vim /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO="static" ONBOOT=yes IPADDR=192.168.8.106 NETMASK=255.255.252.0 GATEWAY=192.168.
一、安装gcc依赖 由于 redis 是用 C 语言开发,安装之前必先确认是否安装 gcc 环境(gcc -v),如果没有安装,执行以下命令进行安装 [root@localhost local]# yum install -y gcc 二、下载并解压安装包 [root@localhost local
第一步 On CentOS/RHEL 6.*: $ sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm On CentOS/RHEL 7: $
/// <summary> /// 取小写文件名后缀 /// </summary> /// <param name="name">文件名</param> /// <returns>返回小写后缀,不带“.”</ret
which nohup .bash_profile中并source加载 如果没有就安装吧 yum provides */nohup nohup npm run start & nohup ./kibana &
1.1 MySQL安装 1.1.1 下载wget命令 yum -y install wget 1.1.2 在线下载mysql安装包 wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 1.1.3 安装My
重启 reboot shutdown -r now init 6 关闭 init 0 shutdown -h now shutdown -h 20:25 #8点25关机查看内存 free CPU利用率 top 日期 date 设置时间 date 033017002015 #月日时间年 日历 cal
1、firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 :
1 下载并安装MySQL官方的 Yum Repository wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 使用上面的命令就直接下载了安装用的Yum Repository,大概
CentOS6.x CentOS6中转用Upstrat代替以前的init.d/rcX.d的线性启动方式。 一、相关命令 通过initctl help可以查看相关命令 [root@localhost ~]# initctl help Job commands: start Start job. sto
1、使用命令:df -lk 找到已满磁盘 2、使用命令:du --max-depth=1 -h 查找大文件,删除
ifconfig:查看网卡信息 网卡配置文件位置: /etc/sysconfig/network-scripts/文件夹 nmtui:配置网卡 netstat -tlunp:查看端口信息 端口信息存储位置: /etc/services文件 route:查看路由信息 wget:下载网路文件,例如 wg
ps -ef:查看所有进程, ps -ef |grap firewalld 查看与firewalld相关的进程 which :查看进程:which firewalld kill 进程id:杀掉进程 kill 640,强制杀:kill -9 640 man:查看帮助,例如 man ps 查看
useradd:添加用户 useradd abc,默认添加一个abc组 vipw:查看系统中用户 groupadd:添加组groupadd ccna vigr:查看系统中的组 gpasswd:将用户abc添加到ccna组 gpasswd -a abc ccna groups abc:查看用户abc属