监控linux系统

  1. w,uptime命令:
   [root@ligenkelong ~]# w
     12:08:43 up 11:33,  2 users,  load average: 0.00, 0.01, 0.05
    
    [root@ligenkelong ~]# uptime
     12:09:05 up 11:34,  2 users,  load average: 0.00, 0.01, 0.05

2.top命令:
按M:按内存排序
按P:按cpu排序
按1:显示所有cpu负载
top -bn1:静态显示

显示cpu核数:cat /proc/cpuinfo
或者:lscpu

3.free 命令:
查看内存的使用情况:

             total        used        free      shared  buff/cache   available
Mem:           972M        588M        200M        7.7M        183M        203M
Swap:          2.0G          0B        2.0G

在这里插入图片描述
添加swap交换空间:

dd if=/dev/zero of=/file bs=1M count=1000
mkswap /file
swapon /file

4.iostat:
yum install -y sysstat
iostat -dx 1 10

iotop:
把所有的进程使用磁盘读写百分比显示出来:

yum install -y iotop

5.vmstat综合命令:

 vmstat 1 10
 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 202156   2076 188960    0    0     2     0   28   48  0  0 100  0  0

网卡流量:

 sar -n DEV 1 10``
sar -n DEV -f /var/log/sa/sa13
sar -b

nload:

yum install -y epel-release
 yum install -y nload

查看网卡:

ethtool ens33
或者
mii-tool ens33

查看进程:

ps aux     
ps -elf
ps -eLf(查看进程)
< 高优先级进程

抓包:

tcpdump -nn -i ens33 port 80 -c 100 -w 1.cap
tcpdump -nn -r 1.cap
tcpdump -nn -i ens33 not port 22 and not port 80 and host 192.168.247.1

安装wireshark:
yum install -y wireshark

监控:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值