0
};
-#define DEFINE_IMAGE(rrdname, _filename, _width, _height) \
+#define DEFINE_IMAGE(rrdname, _filename, _width, _height, time) \
static struct rrd_image rrdname ## daily = { \
.image_filename = _filename "_daily.png", \
.width = _width, \
.height = _height, \
- .timestart = "end-1d", \
+ .timestart = "end-" #time "d", \
.timeend = "now", \
.imageformat = "PNG", \
.options = (char **)&rrdname ## options, \
.image_filename = _filename "_weekly.png", \
.width = _width, \
.height = _height, \
- .timestart = "end-1w", \
+ .timestart = "end-" #time "w", \
.timeend = "now", \
.imageformat = "PNG", \
.options = (char **)&rrdname ## options, \
.image_filename = _filename "_monthly.png", \
.width = _width, \
.height = _height, \
- .timestart = "end-1m", \
+ .timestart = "end-" #time "m", \
.timeend = "now", \
.imageformat = "PNG", \
.options = (char **)&rrdname ## options, \
.image_filename = _filename "_yearly.png", \
.width = _width, \
.height = _height, \
- .timestart = "end-1y", \
+ .timestart = "end-" #time "y", \
.timeend = "now", \
.imageformat = "PNG", \
.options = (char **)&rrdname ## options, \
.text = (char **)&rrdname ## text, \
};
-DEFINE_IMAGE(cpu, "/home/kaapeli/rrdd/sysinfo/images/cpu", 720, 480);
-DEFINE_IMAGE(mem, "/home/kaapeli/rrdd/sysinfo/images/mem", 720, 480);
-DEFINE_IMAGE(systemp, "/home/kaapeli/rrdd/sysinfo/images/systemp", 720, 480);
-DEFINE_IMAGE(eth0, "/home/kaapeli/rrdd/sysinfo/images/eth0", 720, 200);
-DEFINE_IMAGE(eth1, "/home/kaapeli/rrdd/sysinfo/images/eth1", 720, 200);
+DEFINE_IMAGE(cpu, "/home/kaapeli/rrdd/sysinfo/images/cpu", 720, 480, 1);
+DEFINE_IMAGE(mem, "/home/kaapeli/rrdd/sysinfo/images/mem", 720, 480, 1);
+DEFINE_IMAGE(systemp, "/home/kaapeli/rrdd/sysinfo/images/systemp", 720,480,1);
+DEFINE_IMAGE(eth0, "/home/kaapeli/rrdd/sysinfo/images/eth0", 720, 200, 1);
+DEFINE_IMAGE(eth1, "/home/kaapeli/rrdd/sysinfo/images/eth1", 720, 200, 1);
static struct rrd_image *cpu_mem_images[] = {
&cpudaily,