Linux系统之dool命令行工具的基本使用

简介: Linux系统之dool命令行工具的基本使用

一、dool命令行工具介绍

Dool 是一个命令行工具,用于监控系统的许多方面:CPU、内存、网络、平均负载等。它还包括一个强大的插件架构,可以监控其他系统指标。

二、本地系统环境检查

1.检查系统版本

[root@jeven ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
AI 代码解读

2.检查系统内核版本

[root@jeven ~]# uname -r 
6.1.8-1.el7.elrepo.x86_64
AI 代码解读

三、下载dool软件包

1.创建下载目录

[root@jeven ~]# mkdir -p /data/dool
[root@jeven ~]# cd /data/dool
[root@jeven dool]#
AI 代码解读

2.下载dool

https://github.com/scottchiefbaker/dool.git
AI 代码解读

四、安装dool

1.安装python3

yum -y install python3
AI 代码解读

2.安装dool

[root@jeven dool]# cd dool/
[root@jeven dool]# ls
AUTHORS  ChangeLog  COPYING  docs  dool  examples  install.py  Makefile  packaging  plugins  README.md
[root@jeven dool]# python3 install.py 
You are root, doing a local install

Installing binaries to /usr/bin/
Installing plugins  to /usr/share/dool/
Installing manpages to /usr/share/man/man1/

Install complete. Dool installed to /usr/bin/dool
AI 代码解读

五、dool的命令帮助

[root@jeven dool]# dool --help
Usage: dool [options] [delay] [count]

Versatile tool for generating system resource statistics

Dool options:
  -c, --cpu                enable cpu stats
     -C 0,3,total             include cpu0, cpu3 and total
  -d, --disk               enable disk stats
     -D total,hda             include hda and total
  -g, --page               enable page stats
  -i, --int                enable interrupt stats
     -I 5,eth2                include int5 and interrupt used by eth2
  -l, --load               enable load stats
  -m, --mem                enable memory stats
  -n, --net                enable network stats
     -N eth1,total            include eth1 and total
  -p, --proc               enable process stats
  -r, --io                 enable io stats (I/O requests completed)
  -s, --swap               enable swap stats
     -S swap1,total           include swap1 and total
  -t, --time               enable time/date output
  -T, --epoch              enable time counter (seconds since epoch)
  -y, --sys                enable system stats

  --aio                    enable aio stats
  --fs, --filesystem       enable fs stats
  --ipc                    enable ipc stats
  --lock                   enable lock stats
  --raw                    enable raw stats
  --socket                 enable socket stats
  --tcp                    enable tcp stats
  --udp                    enable udp stats
  --unix                   enable unix stats
  --vm                     enable vm stats
  --vm-adv                 enable advanced vm stats
  --zones                  enable zoneinfo stats

  --list                   list all available plugins
  --<plugin-name>          enable external plugin by name (see --list)

  --defaults               equals -cdnlt
  --more                   equals -cdnmplt
  -a, --all                equals -cdngmyplt
  -f, --full               automatically expand -C, -D, -I, -N and -S lists
  -v, --vmstat             equals -pmgdsc -D total

  --bits                   force bits for values expressed in bytes
  --bytes                  force bytes for output measurements
  --float                  force float values on screen
  --integer                force integer values on screen

  --bw, --black-on-white   change colors for white background terminal
  --color                  force colors
  --nocolor                disable colors
  --noheaders              disable repetitive headers
  --noupdate               disable intermediate updates
  --output file            write CSV output to file
  --profile                show profiling statistics when exiting dool
  --ascii                  output table in ascii not unicode box drawing

delay is the delay in seconds between each update (default: 1)
count is the number of updates to display before exiting (default: unlimited)
AI 代码解读

六、dool的基本使用

1.直接使用dool监控系统

[root@jeven dool]# dool
Using default plugins: cpu, disk, net, load
┄┄total┄cpu┄usage┄┄┬┄dsk/total┄┬┄net/total┄┬┄┄┄load┄avg┄┄┄┬┄┄┄┄┄system┄┄┄┄
usr sys idl wai stl│ read  writ│ recv  send│ 1m   5m  15m │      time     
  0   0  99   0   0│ 373K 1639K│   0     0 │0.05 0.09 0.06│Feb-11 12:08:29
  0   0 100   0   0│   0     0 │ 960B 8816B│0.05 0.09 0.06│Feb-11 12:08:30
  0   1  99   0   0│   0     0 │ 960B 3440B│0.05 0.09 0.06│Feb-11 12:08:31
  0   0 100   0   0│   0     0 │ 480B 2960B│0.05 0.09 0.06│Feb-11 12:08:32
  0   0 100   0   0│   0     0 │ 480B 2960B│0.05 0.09 0.06│Feb-11 12:08:33
  0   0 100   0   0│   0    66K│ 480B 2960B│0.04 0.09 0.06│Feb-11 12:08:34
  0   0 100   0   0│   0     0 │ 960B 3088B│0.04 0.09 0.06│Feb-11 12:08:35
  0   0 100   0   0│   0     0 │1440B 3440B│0.04 0.09 0.06│Feb-11 12:08:36
  0   0 100   0   0│   0     0 │2016B 4016B│0.04 0.09 0.06│Feb-11 12:08:37
  0   0 100   0   0│   0     0 │5392B 2960B│0.04 0.09 0.06│Feb-11 12:08:38
  0   1  99   0   0│   0   131K│5392B 2960B│0.04 0.09 0.06│Feb-11 12:08:39
  0   0 100   0   0│   0     0 │ 960B 3088B│0.04 0.09 0.06│Feb-11 12:08:40
  0   0 100   0   0│   0     0 │  15K 7664B│0.04 0.09 0.06│Feb-11 12:08:41
  0   0 100   0   0│   0     0 │1632B 4352B│0.04 0.09 0.06│Feb-11 12:08:42
  0   0 100   0   0│   0     0 │ 960B 2960B│0.04 0.09 0.06│Feb-11 12:08:43
  0   1  99   0   0│   0    98K│ 960B 2960B│0.04 0.09 0.06│Feb-11 12:08:44
  0   0 100   0   0│   0     0 │1448B 3744B│0.04 0.09 0.06│Feb-11 12:08:45
  1   0  99   0   0│   0     0 │ 960B 3440B│0.04 0.09 0.06│Feb-11 12:08:46
  0   0 100   0   0│   0     0 │ 480B 2960B│0.04 0.09 0.06│Feb-11 12:08:47
  0   0  99   0   0│   0     0 │2488B 3680B│0.04 0.09 0.06│Feb-11 12:08:48
  1   0  99   0   0│   0     0 │ 480B 2960B│0.03 0.08 0.06│Feb-11 12:08:49
  0   1  99   0   0│   0  1860K│ 480B 3680B│0.03 0.08 0.06│Feb-11 12:08:50
  0   1  99   0   0│   0     0 │2352B 4608B│0.03 0.08 0.06│Feb-11 12:08:51
  0   0 100   0   0│   0     0 │ 480B 4000B│0.03 0.08 0.06│Feb-11 12:08:52
  0   0 100   0   0│   0     0 │ 480B 2960B│0.03 0.08 0.06│Feb-11 12:08:53
  0   1  99   0   0│   0     0 │1536B 4016B│0.03 0.08 0.06│Feb-11 12:08:54
  0   0 100   0   0│   0     0 │ 960B 2960B│0.03 0.08 0.06│Feb-11 12:08:55^
AI 代码解读

2.监控cpu和网络接口

  • 显示CPU使用情况和每个网络接口
dool --cpu --net --time --full 15
AI 代码解读

3.监控内存和磁盘

  • 显示磁盘情况和内存占用
[root@jeven dool]# dool --disk --mem 5 
┄dsk/total┄┬┄┄┄┄┄┄memory┄usage┄┄┄┄┄
 read  writ│ used  free  cach  avai
 371K 1632K│3511M  144M 3570M 4069M
   0    20K│3511M  144M 3570M 4069M
   0    26K│3511M  144M 3570M 4069M
   0    83K│3490M  165M 3570M 4090M
   0     0 │3491M  164M 3570M 4089M
   0  6554B│3490M  165M 3570M 4090M
   0     0 │3493M  162M 3570M 4087M
   0  6554B│3507M  148M 3570M 4073M
   0    26K│3507M  148M 3570M 4073M
AI 代码解读

4.监控cpu/负载/swap

  • 监控cpu/负载/swap情况
[root@jeven dool]# dool --cpu --load --swap --time 60
┄┄total┄cpu┄usage┄┄┬┄┄┄load┄avg┄┄┄┬┄┄┄┄swap┄┄┄┬┄┄┄┄┄system┄┄┄┄
usr sys idl wai stl│ 1m   5m  15m │ used  free│      time     
  0   0  99   0   0│0.02 0.05 0.05│4612K 2039M│Feb-11 12:15:48
AI 代码解读
相关实践学习
CentOS 8迁移Anolis OS 8
Anolis OS 8在做出差异性开发同时,在生态上和依赖管理上保持跟CentOS 8.x兼容,本文为您介绍如何通过AOMS迁移工具实现CentOS 8.x到Anolis OS 8的迁移。
目录
打赏
0
1
1
0
1262
分享
相关文章
Linux系统资源管理:多角度查看内存使用情况。
要知道,透过内存管理的窗口,我们可以洞察到Linux系统运行的真实身姿,如同解剖学家透过微观镜,洞察生命的奥秘。记住,不要惧怕那些高深的命令和参数,他们只是你掌握系统"魔法棒"的钥匙,熟练掌握后,你就可以骄傲地说:Linux,我来了!
67 27
|
9天前
|
Linux系统ext4磁盘扩容实践指南
这个过程就像是给你的房子建一个新的储物间。你需要先找到空地(创建新的分区),然后建造储物间(格式化为ext4文件系统),最后将储物间添加到你的房子中(将新的分区添加到文件系统中)。完成这些步骤后,你就有了一个更大的储物空间。
58 10
|
2月前
|
Linux系统之whereis命令的基本使用
Linux系统之whereis命令的基本使用
104 24
Linux系统之whereis命令的基本使用
|
20天前
|
Linux系统中如何查看CPU信息
本文介绍了查看CPU核心信息的方法,包括使用`lscpu`命令和读取`/proc/cpuinfo`文件。`lscpu`能快速提供逻辑CPU数量、物理核心数、插槽数等基本信息;而`/proc/cpuinfo`则包含更详细的配置数据,如核心ID和处理器编号。此外,还介绍了如何通过`lscpu`和`dmidecode`命令获取CPU型号、制造商及序列号,并解释了CPU频率与缓存大小的相关信息。最后,详细解析了`lscpu`命令输出的各项参数含义,帮助用户更好地理解CPU的具体配置。
59 8
深度体验阿里云系统控制台:SysOM 让 Linux 服务器监控变得如此简单
作为一名经历过无数个凌晨三点被服务器报警电话惊醒的运维工程师,我对监控工具有着近乎苛刻的要求。记得去年那次大型活动,我们的主站流量暴增,服务器内存莫名其妙地飙升到90%以上,却找不到原因。如果当时有一款像阿里云 SysOM 这样直观的监控工具,也许我就不用熬通宵排查问题了。今天,我想分享一下我使用 SysOM 的亲身体验,特别是它那令人印象深刻的内存诊断功能。
|
10天前
|
微服务2——MongoDB单机部署4——Linux系统中的安装启动和连接
本节主要介绍了在Linux系统中安装、启动和连接MongoDB的详细步骤。首先从官网下载MongoDB压缩包并解压至指定目录,接着创建数据和日志存储目录,并配置`mongod.conf`文件以设定日志路径、数据存储路径及绑定IP等参数。之后通过配置文件启动MongoDB服务,并使用`mongo`命令或Compass工具进行连接测试。此外,还提供了防火墙配置建议以及服务停止的两种方法:快速关闭(直接杀死进程)和标准关闭(通过客户端命令安全关闭)。最后补充了数据损坏时的修复操作,确保数据库的稳定运行。
41 0
Linux系统查看操作系统版本信息、CPU信息、模块信息
在Linux系统中,常用命令可帮助用户查看操作系统版本、CPU信息和模块信息
205 23

热门文章

最新文章