Feature #244

Network interface statistics for KVM

Added by Javi Fontan about 11 years ago. Updated over 10 years ago.

Status:ClosedStart date:05/17/2010
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - Auth
Target version:Release 2.0
Resolution: Pull request:

Description

Currently VMM KVM driver does not retrieve network statistics. Rogier Mars has created a patch to get this information, here follows his email:

I've created a quick patch (see below) to the file one_vmm_kvm.rb to include proper monitoring of network interface statistics for KVM.
This patch uses the libvirt dumpxml command and domifstat to get interface statistics.

I've attached the updated one_vmm_kvm.rb file, see the patch below.

Best regards,

Rogier

42a43
> require 'rexml/document'
61c62,65
<         :poll     => "virsh --connect #{LIBVIRT_URI} dominfo" 
---
>         :poll     => "virsh --connect #{LIBVIRT_URI} dominfo",
>         :netstats => "virsh --connect #{LIBVIRT_URI} domifstat",
>         :dumpxml  => "virsh --connect #{LIBVIRT_URI} dumpxml" 
>
146a151,162
>         exe2  = SSHCommand.run("#{LIBVIRT[:dumpxml]} #{deploy_id}", host,
>                               log_method(id))
>
>        doc = REXML::Document.new(exe2.stdout)
>        interfaces = []
>        doc.elements.each('domain/devices/interface/target') do |ele|
>           interfaces << ele.attributes["dev"]
>        end
>
>         exe3  = SSHCommand.run("#{LIBVIRT[:netstats]} #{deploy_id} #{interfaces}", host,
>                               log_method(id))
>
182a199
>
185a203,212
>         exe3.stdout.each_line {|line|
>             columns=line.split(" ").collect {|c| c.strip }
>             case columns[1]
>                 when 'rx_bytes'
>                     info << " #{POLL_ATTRIBUTE[:netrx]}="  << (columns[2].to_i).to_s
>                 when 'tx_bytes'
>                     info << " #{POLL_ATTRIBUTE[:nettx]}="  << (columns[2].to_i).to_s
>             end
> }
>

Associated revisions

Revision cc827fb5
Added by Jaime Melis almost 11 years ago

Applied patch for network device statistics in KVM (#244)

Revision ff8e45da
Added by Javi Fontan over 10 years ago

New probes and ganglia readers (from branch feature-446)

Feature #244: Network interface statistics for KVM
Feature #446: Probe to get monitoring info from ganglia
Feature #472: Get cpu consumption from KVM VMs

poll_xen_kvm.rb - This new probe gets information from XEN and KVM vms.
If it is called with the name of a VM then its monitoring information
is written in standard poll probe way. If called without parameters
a base64-encoded yaml-representation of a hash containing the information
about all the VMs running in the host is returned.

poll_ganglia.rb - This probe gets information from ganglia pushed by gmetric.
Consumes the information generated by poll_xen_kvm.rb

ganglia_probe - Gets host monitoring information from ganglia. It pushes all
metrics that start by OPENNEBULA_

Ganglia.rb - library that holds ganglia reading code

History

#1 Updated by Ruben S. Montero about 11 years ago

  • Target version deleted (Release 2.0)

#2 Updated by Ruben S. Montero almost 11 years ago

  • Assignee changed from Javi Fontan to Jaime Melis
  • Target version set to Release 2.0

#3 Updated by Jaime Melis almost 11 years ago

  • Status changed from New to Closed

Fixed according to the proposed solution. Closing ticket.

#4 Updated by Ruben S. Montero almost 11 years ago

  • Status changed from Closed to Assigned

This functionality has been lost since the migration to the remotes scripts.

#5 Updated by Daniel Molina over 10 years ago

  • Target version deleted (Release 2.0)

#6 Updated by Ruben S. Montero over 10 years ago

  • Status changed from Assigned to Closed
  • Target version set to Release 2.0

This has been implemented in since 2.2

Also available in: Atom PDF