使用collectd与visage收集kvm虚拟机性能实时图形
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了使用collectd与visage收集kvm虚拟机性能实时图形,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3580字,纯文字阅读大概需要6分钟。
内容图文
软件功能:
通过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>
service collectd start
安装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:19ollectd编译安转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"
原文:http://www.cnblogs.com/mengfanrong/p/4298535.html
内容总结
以上是互联网集市为您收集整理的使用collectd与visage收集kvm虚拟机性能实时图形全部内容,希望文章能够帮你解决使用collectd与visage收集kvm虚拟机性能实时图形所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。