使用collectd与visage收集kvm虚拟机性能实时图形
2024-08-25 06:47:52
软件功能:
通过collectd软件来监控收集kvm虚拟机的性能数据,包含cpu,memory、磁盘IO、网络流量等
通过visage软件将收集到的数据绘制图形。
安装:
系统环境:ubuntu12.04
collectd
首先、在collectd官网下载collectd包collectd-5.4.0
安装collectd依赖包
apt-get install bison flex autoconf pkg-config libtool libgcrypt11-dev librrd-dev
安装完毕后,到collectd-5.4.0文件夹下编译源代码并安装
./configure --prefix=/ --exec-prefix=/usr --enable-cpu --enable-network --enable-libvirt --enable-logfile --enable-rrdtool --enable-rrdcached
make&&make install
改动配置
mkdir /etc/collect
mv /etc/collectd.conf /etc/collect
vi /etc/collect/collectd.conf
在collectd.conf文件里改动内容
LoadPlugin syslog
LoadPlugin logfile <Plugin logfile>
LogLevel info
File STDOUT
Timestamp true
PrintSeverity false
</Plugin> <Plugin syslog>
LogLevel info
</Plugin> LoadPlugin cpu
LoadPlugin df
LoadPlugin disk
LoadPlugin interface
LoadPlugin irq
LoadPlugin libvirt
LoadPlugin load
LoadPlugin memory
LoadPlugin network
LoadPlugin processes
LoadPlugin rrdcached
LoadPlugin rrdtool
LoadPlugin users <Plugin network>
# # client setup:
Server "192.168.0.12" "25826" //客户端配置收集数据的服务端 IP +port
Server "192.168.0.16" "25826"
# <Server "239.192.74.66" "25826">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
# </Server>
# TimeToLive "128"
#
# # server setup:
Listen "192.168.0.16" "25826" //collectd作为收集服务端须要打开listen IP + port
# <Listen "239.192.74.66" "25826">
</Plugin> <Plugin libvirt>
Connection "qemu:///system"
RefreshInterval 60
# Domain "name"
BlockDevice "/:hdc/"
# InterfaceDevice "name:device"
IgnoreSelected true
HostnameFormat uuid
InterfaceFormat "address"
</Plugin>
在安装文件夹下将collectd运行文件复制到/ect/init.d/文件夹下然后启动collectd
service collectd start
visage
安装visage依赖包
apt-get install -y build-essential librrd-ruby ruby ruby-dev rubygems
安装visage软件
apt-get install gem
gem install visage-app
启动visage
visage-app start
启动后訪问visage-app的web界面
http://visage-app-server:9292
错误解答:
启动visage-app报错:
root@PS-8:/# visage-app start
/var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app/types.rb:19:in `initialize': No such file or directory - /usr/share/collectd/types.db (Errno::ENOENT)
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app/types.rb:19:in `new'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app/types.rb:19:in `build'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app/types.rb:10:in `initialize'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app.rb:34:in `new'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app.rb:34
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app/config.rb:6:in `use'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app.rb:31
from /var/lib/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1273:in `configure'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/lib/visage-app.rb:30
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/visage-app-2.1.0/bin/visage-app:17
from /usr/local/bin/visage-app:19:in `load'
from /usr/local/bin/visage-app:19
ollectd编译安转types.rb默认在文件夹/share/collectd/文件夹下,将types.rb文件复制到/usr/share/collectd文件夹下,并将collectd.conf配置文件里设置參数:
TypesDB "/usr/share/collectd/types.db"
然后再启动collectd和visage-app
visage-app收集不到数据
在visage-app界面上查看不到server?
visage-app启动默认是在文件夹/var/lib/collectd/rrd文件夹下去收集server,可是collectd编译安装数据默认在/var/lib/collectd/文件夹下。在collectd.conf配置文件里设置參数:
BaseDir "/var/lib/collectd/rrd"
最新文章
- Atitit.技术管理者要不要自己做开发??
- 你真的会用java replaceAll函数吗?
- AngularJs自定义指令详解(7) - multiElement
- OpenGL开发时,fatal error C1083: 无法打开包括文件:“gl\glut.h”: No such file or directory
- [Everyday Mathematics]20150122
- 怎么给qt程序添加版本信息
- C# 后台调用前台JS
- 201521123066《Java程序设计》第八周学习总结
- VR一体机如何退出FFBM(QFIL)
- JS浏览器兼容问题
- Reporting Service 2008 &ldquo;报表服务器数据库内出错。此错误可能是因连接失败、超时或数据库中磁盘空间不足而导致的&rdquo;
- [flask]gunicorn配置文件
- 【工具相关】Web-XAMPP的安装
- 杜教BM
- php上传导入文件 nginx-502错误
- Passbook
- java.security.InvalidKeyException: Illegal key size aes解密失败
- 通过 CeSi + Supervisor 可视化集中管理服务器节点进程
- day8--by a gentlement man
- stringbuffer 和 stringbuilder区别
热门文章
- android采用videoView播放视频(包装)
- [Cocos2d-x]在Cocos2d-x 3.x如何通过版本号WebSocket连接server数据的传输
- POJ 2418 Hardwood Species(STL在map应用)
- Canvas的方法覆盖和实现新的API
- Java并发编程之ConcurrentHashMap(转)
- 【Unity 3D】学习笔记三十五:游戏实例——摄像机切换镜头
- [2011山东ACM省赛] Identifiers(模拟)
- 采用Flume实时采集和处理数据
- HDU 2120 Ice_cream&;#39;s world I(并检查集合)
- TextView——setCompoundDrawables说明