“ 目录:RHCA+ -> 12 系统监控 -> 8 glances命令(监控系统资源) ”
查看CPU、内存、网络、磁盘、进程等监控信息,类似top;语法格式:glances
参数 | 作用 |
-w | 启动网页模式,会同时开启网页和api,默认进程前台驻留 --disable-webui:关闭网页,也就是只提供api --password:设置密码,默认无密码 |
-s | 以服务模式运行,默认会前台驻留 |
-c | 指定要连接的服务端地址 |
-h | 查看帮助 |
交互式命令 | 作用 |
k | 结束选中的进程 |
1 | 查看每个cpu核心资源利用率 |
Ctrl+c | 退出 |
一、安装
[root@wuzuniao ~]# yum -y install epel-release.noarch #安装epel仓库
[root@wuzuniao ~]# yum -y install glances #安装软件
二、使用
1、本地监控
[root@wuzuniao ~]# glances #查看系统监控
2、web监控
[root@wuzuniao171 ~]# glances -w --password #开启web服务并设置密码
Define the Glances webserver password (glances username): #设置密码
Password (confirm): #重复输入密码
Do you want to save the password? [Yes/No]: yes #同意保存
Glances Web User Interface started on http://0.0.0.0:61208/
浏览器访问:http://服务器IP:61208/
账密:glances/自己设置的密码
3、CS模式
[root@wuzuniao171 ~]# glances -s #服务端启动进程,默认会前台驻留
Glances XML-RPC server is running on 0.0.0.0:61209
[root@wuzuniao172 ~]# glances -c 192.168.1.171 #客户端指定地址连接