[pve-devel] adding a new value in rrd ?

Alexandre DERUMIER aderumier at odiso.com
Mon Jan 14 16:54:23 CET 2013


Ok, I didn't understand because I thinked that the rrds files were replicated between nodes,
but this in only new values which are streamed, then each node update the rrds locally.

so for status.c , I use this:

add new steam (pve2.3-vm), and write to /var/lib/rrdcached/db/pve2-vm
keep oldsteam (pve2-vm), for datas coming from oldnodes.

Is it ok for you ?



        } else if (strncmp(key, "pve2.3-vm/", 10) == 0) {
                const char *vmid = key + 10;

                skip = 3;

                if (strchr(vmid, '/') != NULL)
                        goto keyerror;

                if (strlen(vmid) < 1)
                        goto keyerror;

                filename = g_strdup_printf(RRDDIR "/%s/%s", "pve2-vm", vmid);

                if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {

                        mkdir(RRDDIR "/pve2-vm", 0755);
                        int argcount = sizeof(rrd_def_vm)/sizeof(void*) - 1;
                        create_rrd_file(filename, argcount, rrd_def_vm);
                }


        } else if (strncmp(key, "pve2-vm/", 8) == 0) {
                const char *vmid = key + 8;

                skip = 2;

                if (strchr(vmid, '/') != NULL)
                        goto keyerror;

                if (strlen(vmid) < 1)
                        goto keyerror;

                if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {

                        mkdir(RRDDIR "/pve2-vm", 0755);
                        int argcount = sizeof(rrd_def_vm)/sizeof(void*) - 1;
                        create_rrd_file(filename, argcount, rrd_def_vm);
                }

        }


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

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Lundi 14 Janvier 2013 11:46:04 
Objet: RE: [pve-devel] adding a new value in rrd ? 


> But if I only change the broadcast , it'll recreate an new empty rrd ..? 


No. Instead pve-cluster/data/src/status.c update_rrd_data() will trigger an error. 

So you need to modify that to understand the new format. 



More information about the pve-devel mailing list