add vm rrd generator
This commit is contained in:
parent
091eee2671
commit
c7c18e585a
1 changed files with 9 additions and 9 deletions
18
plugin.py
18
plugin.py
|
@ -241,20 +241,20 @@ def vmrrd(vm_id):
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
if vm_type == 'kvm':
|
if vm_type == 'kvm':
|
||||||
result['cpu'] = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='cpu')
|
rcpu = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='cpu')
|
||||||
result['mem'] = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='mem,maxmem')
|
rmem = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='mem,maxmem')
|
||||||
result['net'] = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='netin,netout')
|
rnet = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='netin,netout')
|
||||||
result['hdd'] = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='diskread,diskwrite')
|
rhdd = proxobject.nodes(slave_name).qemu(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='diskread,diskwrite')
|
||||||
|
|
||||||
if vm_type == 'lxc':
|
if vm_type == 'lxc':
|
||||||
result['cpu'] = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='cpu')
|
rcpu = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='cpu')
|
||||||
result['mem'] = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='mem,maxmem')
|
rmem = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='mem,maxmem')
|
||||||
result['net'] = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='netin,netout')
|
rnet = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='netin,netout')
|
||||||
result['hdd'] = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='diskread,diskwrite')
|
rhdd = proxobject.nodes(slave_name).lxc(vm_id).rrd.get(timeframe='day', cf='AVERAGE', ds='diskread,diskwrite')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
repsonse = { 'status':'RRD', 'vmid':vm_id, 'rrd':result }
|
response = { 'status':'RRD', 'vmid':vm_id, 'cpu':rcpu, 'mem':rmem, 'net':rnet, 'hdd',rhdd }
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def vmvnc(vm_id):
|
def vmvnc(vm_id):
|
||||||
|
|
Loading…
Reference in a new issue