summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 299153f)
raw | patch | inline | side by side (parent: 299153f)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 24 Feb 2007 17:23:02 +0000 (17:23 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 24 Feb 2007 17:23:02 +0000 (17:23 +0000) |
program/src/rrd_dump.c | patch | blob | history | |
program/src/rrd_info.c | patch | blob | history | |
program/src/rrd_tune.c | patch | blob | history |
diff --git a/program/src/rrd_dump.c b/program/src/rrd_dump.c
index 4edd7c0923acb5f478a4311c8c0a44ec75c553d6..4e79c9c57e30b99abd1733b47c38a0ecbe5edf86 100644 (file)
--- a/program/src/rrd_dump.c
+++ b/program/src/rrd_dump.c
fprintf(out_file, "\t<lastupdate> %ld </lastupdate> <!-- %s -->\n\n",
rrd.live_head->last_up,somestring);
for(i=0;i<rrd.stat_head->ds_cnt;i++){
- fprintf(out_file, "\t<ds>\n");
- fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
- fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
- if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
- fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
- if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
- fprintf(out_file, "\t\t<min> NaN </min>\n");
- } else {
- fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
- }
- if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
- fprintf(out_file, "\t\t<max> NaN </max>\n");
- } else {
- fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
- }
- } else { /* DST_CDEF */
- char *str;
- rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
- fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
- free(str);
- }
- fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
- fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
- if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
- fprintf(out_file, "\t\t<value> NaN </value>\n");
- } else {
- fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
- }
- fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
- rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
+ fprintf(out_file, "\t<ds>\n");
+ fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
+ fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
+ if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
+ fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
+ if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
+ fprintf(out_file, "\t\t<min> NaN </min>\n");
+ } else {
+ fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
+ }
+ if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
+ fprintf(out_file, "\t\t<max> NaN </max>\n");
+ } else {
+ fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
+ }
+ } else { /* DST_CDEF */
+ char *str=NULL;
+ rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
+ fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
+ free(str);
+ }
+ fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
+ fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
+ if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
+ fprintf(out_file, "\t\t<value> NaN </value>\n");
+ } else {
+ fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
+ }
+ fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
+ rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
- fprintf(out_file, "\t</ds>\n\n");
- }
+ fprintf(out_file, "\t</ds>\n\n");
+ }
fputs("<!-- Round Robin Archives -->", out_file);
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index 1ff1659b8f66241b53b94b9dc1bb599c2a0c8270..91f49598b134019efa426c81b8aaf67990b19269 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
switch (current_ds) {
case DST_CDEF:
{
- char *buffer = 0;
+ char *buffer = NULL;
rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),
rrd.ds_def, &buffer);
info.u_str = buffer;
diff --git a/program/src/rrd_tune.c b/program/src/rrd_tune.c
index ecdedf29f18c3b36581bfdf5d4e7ec857698416f..5651ad0288f9826727a862f2ae4207a634d24950 100644 (file)
--- a/program/src/rrd_tune.c
+++ b/program/src/rrd_tune.c
rrd.ds_def[i].par[DS_min_val].u_val,
rrd.ds_def[i].par[DS_max_val].u_val);
} else {
- char *buffer;
+ char *buffer = NULL;
rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&buffer);
printf("DS[%s] typ: %s\tcdef: %s\n", rrd.ds_def[i].ds_nam,rrd.ds_def[i].dst,buffer);
free(buffer);