如何用linuxlinux 离线安装nginxglances?

Glances系统监控工具安装和使用
Glances 是前几天网上闲逛的时候发现的一款 新 系统监控工具,尽管现在监控工具有很多选择,Glances 还是有些值得关注的,和那些常用的老牌监控工具比起来,比如 top/vmstat/iostat 只能监
Glances 是前几天网上闲逛的时候发现的一款 &新& 系统监控工具,尽管现在监控工具有很多选择,Glances 还是有些值得关注的,和那些常用的老牌监控工具比起来,比如 top/vmstat/iostat 只能监控本机系统,Glances 可以监控本机也可以通过客户端服务器模式监控其他机器;Glances 提供了基于 XML/RPC 的 API 便于其他程序调用,可编程;Glances 可以将数据输出保存到 csv 或 html 格式的文件方便其他程序处理(报告或绘制图形)。
Glances 是用 Python 开发的,使用 psutil 库来采集系统数据,在用户的终端上实时动态的显示重要的系统数据和变化。显示的数据包括:CPU、内存、磁盘、网络等使用情况,内核、运行队列、负载、I/O 状态、消耗资源最多的进程等等。
Glance 支持 Linux, Mac OS X, FreeBSD, Windows 等多个系统,安装也很方便。在 Ubuntu 上安装:
$ sudo apt-get update
$ sudo apt-get install python-pip build-essential python-dev
$ sudo pip install Glances
在 CentOS 6.x 上安装:
# rpm -ivh http://fr2.rpmfind.net/linux/epel/6/x86_64/epel-release-6-7.noarch.rpm
# yum install python-pip python-devel
# pip-python install glances
在 FreeBSD 上安装:
# pkg_add -r py27-glances
# cd /usr/ports/sysutils/py-glances/
# make install clean
Glances 可以单机使用,也可以客户端-服务器模式多机使用。单机使用很简单,直接运行就可以了:
客户端-服务器模式稍微复杂一点,需要在一台机器上以服务器模式启动 glances -s,另外一台机器以客户端模式连接 glances -c. 比如在有两台机器 A 和 B 都装了 glances,要想在 A 上看 B 上的 glances 的话需要事先在 B 上用服务器模式启动 glances(假设 B 的 IP 地址是 192.168.2.22):
$ glances -s
然后再从 A(客户端)用 Glances 访问 B(服务器):
$ glances -c 192.168.2.22
Glances 和其他一堆老牌系统监控工具相比其突出优点在于提供 XML-RPC API,可编程。使用 Glances 提供的 API,我们可以通过编程轻松获取(我们想要的)数据。比如下面的是一个打印系统信息的简单 Python 脚本:
$ vi test.py
#!/usr/bin/python
import xmlrpclib
s = xmlrpclib.ServerProxy('http://192.168.2.22:61209')
print s.getSystem()
运行上面这个脚本:
$ python test.py
{&linux_distro&: &Ubuntu 12.04&, &platform&: &64bit&, &os_name&: &Linux&, &hostname&: &vpsee.com&, &os_version&: &3.2.0-23-virtual&}
Glances 的界面:
转载请保留固定链接:
------分隔线----------------------------
fail2ban是由Python语言开发监控软件,通过监控系统日志(Debian/...
Linux在4.9版本的内核新增了一款TCP拥塞控制技术:BBR, Linode 最新...
概述 RabbitMQ是一个开源的AMQP实现,服务器端用Erlang语言编写,支...
概述 RabbitMQ是一个开源的AMQP实现,服务器端用Erlang语言编写,支...
一、使用背景 当生产环境有很多服务器、很多业务模块的日志需...
What is the opcode cache? When the interpreter to complete the analysis of script...没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!扫一扫体验手机阅读
centos6.6 安装 glances
<span type="1" blog_id="1789977" userid='
分享到朋友圈
关注作者,不错过每一篇精彩Glances是Linux下的监控工具,能够对Linux系统的性能及使用情况进行监控,安装完Glances,就可以使用Glances命令进行相关监控了,下面小编就给大家详细介绍下Linux安装和使用Glances的方法,感兴趣的朋友可以来了解下。
Glances安装
Glances安装要求:python 》= 2.6 和 psutil 》= 0.4.1
# pip install psutil
# pip install pysensors
# pip install hddtemp
# git clone
# cd glances
# python setup.py install
Glances的使用
# glances -h
Glances version 1.7a with PsUtil 0.7.1
Usage: glances [opt]
with opt:
-b Display network rate in Byte per second
-B @IP|host Bind server to the given IP or host NAME
-c @IP|host Connect to a Glances server
-C file Path to the configuration file
-d Disable disk I/O module
-e Enable the sensors module (Linux-only)
-f file Set the output folder (HTML) or file (CSV)
-h Display the syntax and exit
-m Disable mount module
-n Disable network module
-o output Define additional output (available: HTML or CSV)
-p PORT Define the client or server TCP port (default: 61209)
-P password Client/server password
-r Do not list processes (significant CPU use reduction)
-s Run Glances in server mode
-t sec Set the refresh time in seconds (default: 3)
-v Display the version and exit
-y Enable the hddtemp module (needs running hddtemp daemon)
-z Do not use the bold color attribute
-1 Start Glances in per CPU mode
上面就是Linux安装使用Glances的方法介绍了,Glances搭配上各种参数能够实现Linux监控的不同功能,详细查看负载、内存等信息。没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!

我要回帖

更多关于 linux 离线安装nginx 的文章

 

随机推荐