[pve-devel] Count monthly traffic

Alexandre DERUMIER aderumier at odiso.com
Tue Mar 12 14:04:29 CET 2013


>>2.) What are these skip steps? in status.c? 
some values are streamed, but not writen in rrd files. (they are only in memory)

check API2Tools.pm for example:

    if ($d = $rrd->{"pve2-vm/$vmid"}) {

        $entry->{uptime} = ($d->[0] || 0) + 0;
        $entry->{name} = $d->[1];
        $entry->{status} = $entry->{uptime} ? 'running' : 'stopped';
        $entry->{maxcpu} = ($d->[3] || 0) + 0;
        $entry->{cpu} = ($d->[4] || 0) + 0;
        $entry->{maxmem} = ($d->[5] || 0) + 0;
        $entry->{mem} = ($d->[6] || 0) + 0;
        $entry->{maxdisk} = ($d->[7] || 0) + 0;
        $entry->{disk} = ($d->[8] || 0) + 0;
        $entry->{netin} = ($d->[9] || 0) + 0;
        $entry->{netout} = ($d->[10] || 0) + 0;
        $entry->{diskread} = ($d->[11] || 0) + 0;
        $entry->{diskwrite} = ($d->[12] || 0) + 0;

    } 

uptime,name,status are only in memory and not in rrd.

skip = 2 in status.c




>>But then we have 32 values + the old ones in one rrd file. Doesn't it 
>>make sense to introduce new files instead of blowing the old one? 
>>So we have an rrd for each network card? 

Yes, I think it make sense. Like this we can avoid to write null values for non existant network card.
I don't know if Dietmar have an opinion about this.



----- Mail original ----- 

De: "Stefan Priebe - Profihost AG" <s.priebe at profihost.ag> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com, "Dietmar Maurer" <dietmar at proxmox.com> 
Envoyé: Mardi 12 Mars 2013 13:45:44 
Objet: Re: [pve-devel] Count monthly traffic 

Hi, 

i'm still struggling. 

1.) first i need to update the status.c file and introduce: 
pve3.0-vm folder. 
2.) What are these skip steps? in status.c? 
3.) Then i need to update PVE/API2Tools.pm to pass the additional values. 
4.) bin/pvestatd needs to be updated to add the new values 

But then we have 32 values + the old ones in one rrd file. Doesn't it 
make sense to introduce new files instead of blowing the old one? 

Why not using something like this: 
PVE::Cluster::broadcast_rrd("pve2.3-vm/$vmid_net0", $data); 
PVE::Cluster::broadcast_rrd("pve2.3-vm/$vmid_net1", $data); 
... 

So we have an rrd for each network card? 

Stefan 
Am 12.03.2013 05:37, schrieb Alexandre DERUMIER: 
> yes I think you can look at pve2.3 patches in statuc.c .(it's really easy). 
> 
> As an rrd can't be easily changed, you need to create a new rrd file/structure. 
> 
> Each rrd have a "stream", values are send in the stream across each host, then each host write values in rrds. 
> (except some values which are skipped (status.c) and not writen to rrd, but only keep in memory, like "running" value for example) 
> 
> 
> ----- Mail original ----- 
> 
> De: "Stefan Priebe" <s.priebe at profihost.ag> 
> À: "Dietmar Maurer" <dietmar at proxmox.com> 
> Cc: "Alexandre DERUMIER" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
> Envoyé: Lundi 11 Mars 2013 21:32:23 
> Objet: Re: [pve-devel] Count monthly traffic 
> 
> Hi, 
> Am 11.03.2013 16:23, schrieb Dietmar Maurer: 
>>> do i need to add pve2.4? 
>> 
>> next version will be 3.0 ;-) 
>> 
>> This will require some low level C hacking in pve-cluster/data/src/status.c (search for rrd). 
>> We need to create a new rrd definition, and we can use key 'pve3-vmnet'. 
>> 
>> Just tell if you need more help. 
> 
> Thanks i would start to look at Alexandres patches where he introduces 
> pve2.4 would this be a good starting point? 
> 
> Stefan 
> 



More information about the pve-devel mailing list