----- Original Message -----
> From: "Ernest Beinrohr" <ernest.beinr...@axonpro.sk>
> To: "Shanil S" <xielessha...@gmail.com>, users@ovirt.org
> Sent: Tuesday, September 2, 2014 11:24:13 AM
> Subject: Re: [ovirt-users] Real time network usages and IO usages of VM
> 
> Dňa 29.08.2014 07:08, Shanil S wrote / napísal(a):
> 
> 
> 
> Hi All,
> 
> Is there any api methods to get the real time network usages and IO usages os
> of each vm ? I tried it by using api/vms/$id/statistics but its not getting
> the network and IO usages. Is it possible to get these details using the api
> calls ?
> 
> I had to make my own based on the hosts cgroups info. I feed the data to mrtg
> to plot cpu and IO graphs. No network though.
> 
> I run something like this on each hypervisor periodically via mrtg:
> 
> vms=`find /cgroup/blkio/libvirt/qemu/ -maxdepth 1 -mindepth 1 -type d -printf
> "%f\n"`
> IGNORED_REGEX="ignore"
> for vm in $vms
> do
> (
> echo -n "$HOST:$vm:"
> egrep -v "$IGNORED_REGEX"
> /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep ^253:.*Read
> | cut -f3 -d " " | paste -sd+ | bc
> echo -n ":"
> egrep -v "$IGNORED_REGEX"
> /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_serviced | grep
> ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc
> echo -n ":"
> egrep -v "$IGNORED_REGEX"
> /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep
> ^253:.*Read | cut -f3 -d " " | paste -sd+ | bc
> echo -n ":"
> egrep -v "$IGNORED_REGEX"
> /cgroup/blkio/libvirt/qemu/$vm/blkio.throttle.io_service_bytes | grep
> ^253:.*Write | cut -f3 -d " " | paste -sd+ | bc
> echo -n ":"
> cat /cgroup/cpuacct/libvirt/qemu/$vm/cpuacct.usage
> ) | tr -d '\n'
> echo ""
> done
> 
> --
> Ernest Beinrohr, AXON PRO
> Ing , RHCE , RHCVA , LPIC , VCA ,
> +421-2-62410360 +421-903-482603
> 

Hi Ernest
Did you check vms/{vm:id}/disks/{disk:id}/statistics and 
vms/{vm:id}/nics/{nic:id}/statitics ?

See more info here:
http://www.ovirt.org/REST-Api#Where_can_I_find_network_and_IO_statiscs_for_virtual_machines.3F

_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users

Reply via email to