]> git.itanic.dy.fi Git - rrdd/commitdiff
Prepare for the merge
authorTimo Kokkonen <kaapeli@ee.oulu.fi>
Sun, 3 Apr 2011 10:20:11 +0000 (13:20 +0300)
committerTimo Kokkonen <kaapeli@ee.oulu.fi>
Sun, 3 Apr 2011 10:20:11 +0000 (13:20 +0300)
Signed-off-by: Timo Kokkonen <kaapeli@ee.oulu.fi>
database.h [deleted file]
database.h.example

diff --git a/database.h b/database.h
deleted file mode 100644 (file)
index ffc979f..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-#ifndef _TESTDATA_H
-#define _TESTDATA_H
-
-#include "rrdtool.h"
-#include "scheduler.h"
-#include "parser.h"
-
-const char blank[] = "COMMENT:       ";
-#define tempfmt "% 6.2lf °C"
-
-#define numfmt " % 8.2lf "
-
-#define SYSINFO_PATH           "/home/kaapeli/sysinfo/"
-#define SYSINFO_RRD_PATH       SYSINFO_PATH "sysinfo.rrd"
-#define SYSINFO_IMAGES_PATH    SYSINFO_PATH "images/"
-
-#define DIGITEMP_RRD_PATH      "/home/kaapeli/digitemp/digitemp.rrd"
-#define HDTEMP_RRD_PATH                "/root/hdtemp/hdtemp.rrd"
-
-const char *cputext[] = {
-       "DEF:us=" SYSINFO_RRD_PATH ":User:AVERAGE",
-       "DEF:ni=" SYSINFO_RRD_PATH ":Nice:AVERAGE",
-       "DEF:sy=" SYSINFO_RRD_PATH ":Sys:AVERAGE",
-       "DEF:id=" SYSINFO_RRD_PATH ":Idle:AVERAGE",
-       "DEF:wa=" SYSINFO_RRD_PATH ":Wait:AVERAGE",
-       "DEF:in=" SYSINFO_RRD_PATH ":IRQ:AVERAGE",
-       "DEF:so=" SYSINFO_RRD_PATH ":SoftIRQ:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                   "
-       "MIN          MAX         AVG        Last\\n",
-       blank,
-       "AREA:sy#ff0000:System   ",
-       "GPRINT:sy:MIN:" numfmt,
-       "GPRINT:sy:MAX:" numfmt,
-       "GPRINT:sy:AVERAGE:" numfmt,
-       "GPRINT:sy:LAST:" numfmt "\\n",
-       blank,
-       "STACK:us#0000ff:User     ",
-       "GPRINT:us:MIN:" numfmt,
-       "GPRINT:us:MAX:" numfmt,
-       "GPRINT:us:AVERAGE:" numfmt,
-       "GPRINT:us:LAST:" numfmt "\\n",
-       blank,
-       "STACK:ni#00ff00:Nice     ",
-       "GPRINT:ni:MIN:" numfmt,
-       "GPRINT:ni:MAX:" numfmt,
-       "GPRINT:ni:AVERAGE:" numfmt,
-       "GPRINT:ni:LAST:" numfmt "\\n",
-       blank,
-       "STACK:id#ffffff:Idle     ",
-       "GPRINT:id:MIN:" numfmt,
-       "GPRINT:id:MAX:" numfmt,
-       "GPRINT:id:AVERAGE:" numfmt,
-       "GPRINT:id:LAST:" numfmt "\\n",
-       blank,
-       "STACK:wa#ff00ff:IO wait  ",
-       "GPRINT:wa:MIN:" numfmt,
-       "GPRINT:wa:MAX:" numfmt,
-       "GPRINT:wa:AVERAGE:" numfmt,
-       "GPRINT:wa:LAST:" numfmt "\\n",
-       blank,
-       "STACK:in#ffff00:IRQ      ",
-       "GPRINT:in:MIN:" numfmt,
-       "GPRINT:in:MAX:" numfmt,
-       "GPRINT:in:AVERAGE:" numfmt,
-       "GPRINT:in:LAST:" numfmt "\\n",
-       blank,
-       "STACK:so#00ffff:Soft IRQ ",
-       "GPRINT:so:MIN:" numfmt,
-       "GPRINT:so:MAX:" numfmt,
-       "GPRINT:so:AVERAGE:" numfmt,
-       "GPRINT:so:LAST:" numfmt "\\n",
-       "COMMENT: \\n",
-       0
-};
-
-const char *memtext[] = {
-       "DEF:fr=" SYSINFO_RRD_PATH ":Free:AVERAGE",
-       "DEF:bu=" SYSINFO_RRD_PATH ":Buffers:AVERAGE",
-       "DEF:ca=" SYSINFO_RRD_PATH ":Cached:AVERAGE",
-       "DEF:an=" SYSINFO_RRD_PATH ":Anon:AVERAGE",
-       "DEF:sl=" SYSINFO_RRD_PATH ":Slab:AVERAGE",
-       "DEF:ta=" SYSINFO_RRD_PATH ":Tables:AVERAGE",
-       "DEF:sw=" SYSINFO_RRD_PATH ":Swap:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                     "
-       "MIN          MAX         AVG        Last\\n",
-       blank,
-       "AREA:bu#ffff00:Buffers    ",
-       "GPRINT:bu:MIN:" numfmt,
-       "GPRINT:bu:MAX:" numfmt,
-       "GPRINT:bu:AVERAGE:" numfmt,
-       "GPRINT:bu:LAST:" numfmt "\\n",
-       blank,
-       "STACK:an#000000:AnonPages  ",
-       "GPRINT:an:MIN:" numfmt,
-       "GPRINT:an:MAX:" numfmt,
-       "GPRINT:an:AVERAGE:" numfmt,
-       "GPRINT:an:LAST:" numfmt "\\n",
-       blank,
-       "STACK:ca#00ff00:Cached     ",
-       "GPRINT:ca:MIN:" numfmt,
-       "GPRINT:ca:MAX:" numfmt,
-       "GPRINT:ca:AVERAGE:" numfmt,
-       "GPRINT:ca:LAST:" numfmt "\\n",
-       blank,
-       "STACK:fr#ffffff:Free       ",
-       "GPRINT:fr:MIN:" numfmt,
-       "GPRINT:fr:MAX:" numfmt,
-       "GPRINT:fr:AVERAGE:" numfmt,
-       "GPRINT:fr:LAST:" numfmt "\\n",
-       blank,
-       "STACK:sl#00ffff:Slab       ",
-       "GPRINT:sl:MIN:" numfmt,
-       "GPRINT:sl:MAX:" numfmt,
-       "GPRINT:sl:AVERAGE:" numfmt,
-       "GPRINT:sl:LAST:" numfmt "\\n",
-       blank,
-       "STACK:ta#0000ff:PageTables ",
-       "GPRINT:ta:MIN:" numfmt,
-       "GPRINT:ta:MAX:" numfmt,
-       "GPRINT:ta:AVERAGE:" numfmt,
-       "GPRINT:ta:LAST:" numfmt "\\n",
-       blank,
-       "STACK:sw#ff0000:Swap       ",
-       "GPRINT:sw:MIN:" numfmt,
-       "GPRINT:sw:MAX:" numfmt,
-       "GPRINT:sw:AVERAGE:" numfmt,
-       "GPRINT:sw:LAST:" numfmt "\\n",
-       "COMMENT: \\n",
-       0
-};
-
-const char *sensor2_text[] = {
-       "DEF:Anturi2_c=" DIGITEMP_RRD_PATH ":Anturi2:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                                       "
-       "MIN          MAX         AVG        Last\\n",
-       blank,
-       "LINE1:Anturi2_c#0000FF:Outdoor Temperature (sensor2)",
-       "GPRINT:Anturi2_c:MIN: " tempfmt,
-       "GPRINT:Anturi2_c:MAX: " tempfmt,
-       "GPRINT:Anturi2_c:AVERAGE: " tempfmt,
-       "GPRINT:Anturi2_c:LAST: " tempfmt "\\n",
-       "COMMENT: \\n",
-       0,
-};
-
-const char *sensor3_text[] = {
-       "DEF:Anturi3_c=" DIGITEMP_RRD_PATH ":Anturi3:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                                       "
-       "MIN          MAX         AVG        Last\\n",
-       blank,
-       "LINE1:Anturi3_c#ff0000:Indoor Temperature (sensor3) ",
-       "GPRINT:Anturi3_c:MIN: " tempfmt,
-       "GPRINT:Anturi3_c:MAX: " tempfmt,
-       "GPRINT:Anturi3_c:AVERAGE: " tempfmt,
-       "GPRINT:Anturi3_c:LAST: " tempfmt "\\n",
-       "COMMENT: \\n",
-       0,
-};
-
-const char *hdcpu_text[] = {
-       "DEF:hda_c=" HDTEMP_RRD_PATH ":hda:AVERAGE",
-       "DEF:hdb_c=" HDTEMP_RRD_PATH ":hdb:AVERAGE",
-       "DEF:hdc_c=" HDTEMP_RRD_PATH ":hdc:AVERAGE",
-       "DEF:CPU_c=" HDTEMP_RRD_PATH ":CPU:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                                    "
-       "MIN         MAX         AVG        Last\\n",
-       blank,
-       "LINE1:hda_c#0000FF:Seagate Barracuda 7200.7 ",
-       "GPRINT:hda_c:MIN: " tempfmt,
-       "GPRINT:hda_c:MAX: " tempfmt,
-       "GPRINT:hda_c:AVERAGE: " tempfmt,
-       "GPRINT:hda_c:LAST: " tempfmt,
-       "COMMENT: \\n",
-       blank,
-       "LINE1:hdb_c#00FFFF:Maxtor DIAMONDMAX+9      ",
-       "GPRINT:hdb_c:MIN: " tempfmt,
-       "GPRINT:hdb_c:MAX: " tempfmt,
-       "GPRINT:hdb_c:AVERAGE: " tempfmt,
-       "GPRINT:hdb_c:LAST: " tempfmt,
-       "COMMENT: \\n",
-       blank,
-       "LINE1:hdc_c#00FF00:Seagate Barracuda 7200.10",
-       "GPRINT:hdc_c:MIN: " tempfmt,
-       "GPRINT:hdc_c:MAX: " tempfmt,
-       "GPRINT:hdc_c:AVERAGE: " tempfmt,
-       "GPRINT:hdc_c:LAST: " tempfmt,
-       "COMMENT: \\n",
-       blank,
-       "LINE1:CPU_c#FF0000:AMD Athlon XP 2800+      ",
-       "GPRINT:CPU_c:MIN: " tempfmt,
-       "GPRINT:CPU_c:MAX: " tempfmt,
-       "GPRINT:CPU_c:AVERAGE: " tempfmt,
-       "GPRINT:CPU_c:LAST: " tempfmt "\\n",
-       "COMMENT: \\n",
-       0,
-};
-
-const char *cpuoptions[] = {
-       "--alt-autoscale-max",
-       "--lower-limit", "0",
-       "--vertical-label",
-       "CPU Tics",
-       0
-};
-
-const char *memoptions[] = {
-       "--alt-autoscale-max",
-       "--lower-limit", "0",
-       "--vertical-label",
-       "Mem usage (MB)",
-       "--units-exponent", "0",
-       0
-};
-
-const char *sensor2_options[] = {
-       "--alt-autoscale",
-       "--vertical-label", "Temp (C)",
-       0,
-};
-
-const char *sensor3_options[] = {
-       "--alt-autoscale",
-       "--vertical-label", "Temp (C)",
-       0,
-};
-
-const char *hdcpu_options[] = {
-       "--alt-autoscale",
-       "--vertical-label", "Temp (C)",
-       0,
-};
-
-#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-" #time "d",                          \
-               .timeend = "now",                                       \
-               .imageformat = "PNG",                                   \
-               .options = (char **)&rrdname ## options,                \
-               .text = (char **)&rrdname ## text,                      \
-       };                                                              \
-       static struct rrd_image rrdname ## weekly = {                   \
-               .image_filename = _filename "_weekly.png",              \
-               .width = _width,                                        \
-               .height = _height,                                      \
-               .timestart = "end-" #time "w",                          \
-               .timeend = "now",                                       \
-               .imageformat = "PNG",                                   \
-               .options = (char **)&rrdname ## options,                \
-               .text = (char **)&rrdname ## text,                      \
-       };                                                              \
-       static struct rrd_image rrdname ## monthly = {                  \
-               .image_filename = _filename "_monthly.png",             \
-               .width = _width,                                        \
-               .height = _height,                                      \
-               .timestart = "end-" #time "m",                          \
-               .timeend = "now",                                       \
-               .imageformat = "PNG",                                   \
-               .options = (char **)&rrdname ## options,                \
-               .text = (char **)&rrdname ## text,                      \
-       };                                                              \
-       static struct rrd_image rrdname ## yearly = {                   \
-               .image_filename = _filename "_yearly.png",              \
-               .width = _width,                                        \
-               .height = _height,                                      \
-               .timestart = "end-" #time "y",                          \
-               .timeend = "now",                                       \
-               .imageformat = "PNG",                                   \
-               .options = (char **)&rrdname ## options,                \
-               .text = (char **)&rrdname ## text,                      \
-       };
-
-DEFINE_IMAGE(cpu,      "/home/kaapeli/sysinfo/images/cpu", 720, 480, 1);
-DEFINE_IMAGE(mem,      "/home/kaapeli/sysinfo/images/mem", 720, 480, 1);
-DEFINE_IMAGE(sensor2_, "/home/apache2/temperature/sensor2", 600, 200, 2);
-DEFINE_IMAGE(sensor3_, "/home/apache2/temperature/sensor1-3", 600, 200, 2);
-DEFINE_IMAGE(hdcpu_,   "/home/apache2/temperature/hdcpu", 600, 200, 2);
-
-static struct rrd_image *cpu_mem_images[] = {
-       &cpudaily,
-       &cpuweekly,
-       &cpumonthly,
-       &cpuyearly,
-       &memdaily,
-       &memweekly,
-       &memmonthly,
-       &memyearly,
-       0
-};
-
-static struct rrd_image *temp_images[] = {
-       &sensor2_daily,
-       &sensor2_weekly,
-       &sensor2_monthly,
-       &sensor2_yearly,
-       &sensor3_daily,
-       &sensor3_weekly,
-       &sensor3_monthly,
-       &sensor3_yearly,
-       0,
-};
-
-static struct rrd_image *hdcpu_images[] = {
-       &hdcpu_daily,
-       &hdcpu_weekly,
-       &hdcpu_monthly,
-       &hdcpu_yearly,
-       0,
-};
-
-static struct rrd_database cpumem_rrd = {
-       .filename       = SYSINFO_RRD_PATH,
-       .interval       = 120,
-       .parse          = cpu_mem_parser,
-       .images         = (struct rrd_image **)&cpu_mem_images,
-       .name           = "cpumem"
-};
-
-static struct rrd_database digitemp_rrd = {
-       .filename       = DIGITEMP_RRD_PATH,
-       .interval       = 300,
-       .parse          = digitemp_parser_mod,
-       .images         = (struct rrd_image **)&temp_images,
-       .name           = "digitemp",
-};
-
-static struct rrd_database hdtemp_rrd = {
-       .filename       = HDTEMP_RRD_PATH,
-       .interval       = 300,
-       .parse          = 0,
-       .images         = (struct rrd_image **)&hdcpu_images,
-       .name           = "hdtemp",
-};
-
-
-static struct rrd_database *all_rrds[] = {
-       &cpumem_rrd,
-       &digitemp_rrd,
-       &hdtemp_rrd,
-       0,
-};
-
-#endif
index 211da19720b62206d126e950e83f27eecd79616b..5a73ccf1d165d13212ae730125df92acbd2d6bad 100644 (file)
@@ -5,14 +5,17 @@
 #include "scheduler.h"
 #include "parser.h"
 
-const char blank[] = "COMMENT:           ";
+const char blank[] = "COMMENT:       ";
+#define tempfmt "% 6.2lf °C"
+
 #define numfmt " % 8.2lf "
 
-#define SYSINFO_PATH           "/home/kaapeli/rrdd/sysinfo/"
+#define SYSINFO_PATH           "/home/kaapeli/sysinfo/"
 #define SYSINFO_RRD_PATH       SYSINFO_PATH "sysinfo.rrd"
 #define SYSINFO_IMAGES_PATH    SYSINFO_PATH "images/"
 
-#define SYSTEMP_RRD_PATH       "/root/systemp/systemp.rrd"
+#define DIGITEMP_RRD_PATH      "/home/kaapeli/digitemp/digitemp.rrd"
+#define HDTEMP_RRD_PATH                "/root/hdtemp/hdtemp.rrd"
 
 const char *cputext[] = {
        "DEF:us=" SYSINFO_RRD_PATH ":User:AVERAGE",
@@ -85,18 +88,18 @@ const char *memtext[] = {
        "COMMENT:                     "
        "MIN          MAX         AVG        Last\\n",
        blank,
-       "AREA:bu#ffff00:Buffers    ",
-       "GPRINT:bu:MIN:" numfmt,
-       "GPRINT:bu:MAX:" numfmt,
-       "GPRINT:bu:AVERAGE:" numfmt,
-       "GPRINT:bu:LAST:" numfmt "\\n",
-       blank,
-       "STACK:an#000000:AnonPages  ",
+       "AREA:an#000000:AnonPages  ",
        "GPRINT:an:MIN:" numfmt,
        "GPRINT:an:MAX:" numfmt,
        "GPRINT:an:AVERAGE:" numfmt,
        "GPRINT:an:LAST:" numfmt "\\n",
        blank,
+       "STACK:bu#ffff00:Buffers    ",
+       "GPRINT:bu:MIN:" numfmt,
+       "GPRINT:bu:MAX:" numfmt,
+       "GPRINT:bu:AVERAGE:" numfmt,
+       "GPRINT:bu:LAST:" numfmt "\\n",
+       blank,
        "STACK:ca#00ff00:Cached     ",
        "GPRINT:ca:MIN:" numfmt,
        "GPRINT:ca:MAX:" numfmt,
@@ -130,34 +133,76 @@ const char *memtext[] = {
        0
 };
 
-const char *systemptext[] = {
-       "DEF:sda_c=" SYSTEMP_RRD_PATH ":sda:AVERAGE",
-       "DEF:SYS_c=" SYSTEMP_RRD_PATH ":SYS:AVERAGE",
-       "DEF:CPU_c=" SYSTEMP_RRD_PATH ":CPU:AVERAGE",
+const char *sensor2_text[] = {
+       "DEF:Anturi2_c=" DIGITEMP_RRD_PATH ":Anturi2:AVERAGE",
        "COMMENT:\\n",
        blank,
-       "COMMENT:                          "
-       "MIN            MAX             AVG             Last\\n",
+       "COMMENT:                                       "
+       "MIN          MAX         AVG        Last\\n",
        blank,
-       "LINE1:sda_c#0000FF:SAMSUNG HD501LJ      ",
-       "GPRINT:sda_c:MIN:  %5.2lf °C",
-       "GPRINT:sda_c:MAX:     %5.2lf °C",
-       "GPRINT:sda_c:AVERAGE:      %5.2lf °C",
-       "GPRINT:sda_c:LAST:      %5.2lf °C\\n",
+       "LINE1:Anturi2_c#0000FF:Outdoor Temperature (sensor2)",
+       "GPRINT:Anturi2_c:MIN: " tempfmt,
+       "GPRINT:Anturi2_c:MAX: " tempfmt,
+       "GPRINT:Anturi2_c:AVERAGE: " tempfmt,
+       "GPRINT:Anturi2_c:LAST: " tempfmt "\\n",
+       "COMMENT: \\n",
+       0,
+};
+
+const char *sensor3_text[] = {
+       "DEF:Anturi3_c=" DIGITEMP_RRD_PATH ":Anturi3:AVERAGE",
+       "COMMENT:\\n",
        blank,
-       "LINE1:SYS_c#00FF00:Sys Temp              ",
-       "GPRINT:SYS_c:MIN: %5.2lf °C",
-       "GPRINT:SYS_c:MAX:     %5.2lf °C",
-       "GPRINT:SYS_c:AVERAGE:      %5.2lf °C",
-       "GPRINT:SYS_c:LAST:      %5.2lf °C\\n",
+       "COMMENT:                                       "
+       "MIN          MAX         AVG        Last\\n",
        blank,
-       "LINE1:CPU_c#FF0000:Intel Core2 Quad     ",
-       "GPRINT:CPU_c:MIN:  %5.2lf °C",    
-       "GPRINT:CPU_c:MAX:     %5.2lf °C",    
-       "GPRINT:CPU_c:AVERAGE:      %5.2lf °C",    
-       "GPRINT:CPU_c:LAST:      %5.2lf °C\\n", 
+       "LINE1:Anturi3_c#ff0000:Indoor Temperature (sensor3) ",
+       "GPRINT:Anturi3_c:MIN: " tempfmt,
+       "GPRINT:Anturi3_c:MAX: " tempfmt,
+       "GPRINT:Anturi3_c:AVERAGE: " tempfmt,
+       "GPRINT:Anturi3_c:LAST: " tempfmt "\\n",
        "COMMENT: \\n",
-       0
+       0,
+};
+
+const char *hdcpu_text[] = {
+       "DEF:hda_c=" HDTEMP_RRD_PATH ":hda:AVERAGE",
+       "DEF:hdb_c=" HDTEMP_RRD_PATH ":hdb:AVERAGE",
+       "DEF:hdc_c=" HDTEMP_RRD_PATH ":hdc:AVERAGE",
+       "DEF:CPU_c=" HDTEMP_RRD_PATH ":CPU:AVERAGE",
+       "COMMENT:\\n",
+       blank,
+       "COMMENT:                                    "
+       "MIN         MAX         AVG        Last\\n",
+       blank,
+       "LINE1:hda_c#0000FF:Seagate Barracuda 7200.7 ",
+       "GPRINT:hda_c:MIN: " tempfmt,
+       "GPRINT:hda_c:MAX: " tempfmt,
+       "GPRINT:hda_c:AVERAGE: " tempfmt,
+       "GPRINT:hda_c:LAST: " tempfmt,
+       "COMMENT: \\n",
+       blank,
+       "LINE1:hdb_c#00FFFF:Maxtor DIAMONDMAX+9      ",
+       "GPRINT:hdb_c:MIN: " tempfmt,
+       "GPRINT:hdb_c:MAX: " tempfmt,
+       "GPRINT:hdb_c:AVERAGE: " tempfmt,
+       "GPRINT:hdb_c:LAST: " tempfmt,
+       "COMMENT: \\n",
+       blank,
+       "LINE1:hdc_c#00FF00:Seagate Barracuda 7200.10",
+       "GPRINT:hdc_c:MIN: " tempfmt,
+       "GPRINT:hdc_c:MAX: " tempfmt,
+       "GPRINT:hdc_c:AVERAGE: " tempfmt,
+       "GPRINT:hdc_c:LAST: " tempfmt,
+       "COMMENT: \\n",
+       blank,
+       "LINE1:CPU_c#FF0000:AMD Athlon XP 2800+      ",
+       "GPRINT:CPU_c:MIN: " tempfmt,
+       "GPRINT:CPU_c:MAX: " tempfmt,
+       "GPRINT:CPU_c:AVERAGE: " tempfmt,
+       "GPRINT:CPU_c:LAST: " tempfmt "\\n",
+       "COMMENT: \\n",
+       0,
 };
 
 const char *cpuoptions[] = {
@@ -177,18 +222,30 @@ const char *memoptions[] = {
        0
 };
 
-const char *systempoptions[] = {
+const char *sensor2_options[] = {
        "--alt-autoscale",
-       "--vertical-label", "Temp °C",
-       0
+       "--vertical-label", "Temp (C)",
+       0,
+};
+
+const char *sensor3_options[] = {
+       "--alt-autoscale",
+       "--vertical-label", "Temp (C)",
+       0,
 };
 
-#define DEFINE_IMAGE(rrdname, _filename, _width, _height)              \
+const char *hdcpu_options[] = {
+       "--alt-autoscale",
+       "--vertical-label", "Temp (C)",
+       0,
+};
+
+#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,                \
@@ -198,7 +255,7 @@ const char *systempoptions[] = {
                .image_filename = _filename "_weekly.png",              \
                .width = _width,                                        \
                .height = _height,                                      \
-               .timestart = "end-1w",                                  \
+               .timestart = "end-" #time "w",                          \
                .timeend = "now",                                       \
                .imageformat = "PNG",                                   \
                .options = (char **)&rrdname ## options,                \
@@ -208,7 +265,7 @@ const char *systempoptions[] = {
                .image_filename = _filename "_monthly.png",             \
                .width = _width,                                        \
                .height = _height,                                      \
-               .timestart = "end-1m",                                  \
+               .timestart = "end-" #time "m",                          \
                .timeend = "now",                                       \
                .imageformat = "PNG",                                   \
                .options = (char **)&rrdname ## options,                \
@@ -218,16 +275,18 @@ const char *systempoptions[] = {
                .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(cpu,      "/home/kaapeli/sysinfo/images/cpu", 720, 480, 1);
+DEFINE_IMAGE(mem,      "/home/kaapeli/sysinfo/images/mem", 720, 480, 1);
+DEFINE_IMAGE(sensor2_, "/home/apache2/temperature/sensor2", 600, 200, 2);
+DEFINE_IMAGE(sensor3_, "/home/apache2/temperature/sensor1-3", 600, 200, 2);
+DEFINE_IMAGE(hdcpu_,   "/home/apache2/temperature/hdcpu", 600, 200, 2);
 
 static struct rrd_image *cpu_mem_images[] = {
        &cpudaily,
@@ -241,211 +300,24 @@ static struct rrd_image *cpu_mem_images[] = {
        0
 };
 
-static struct rrd_image *systemp_images[] = {
-       &systempdaily,
-       &systempweekly,
-       &systempmonthly,
-       &systempyearly,
-       0
-};
-
-struct rrd_data_source cpumem_sources[] = {
-       {
-               .name = "User",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "Nice",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "Sys",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "Idle",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "Wait",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "IRQ",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "SoftIRQ",
-               .type = "COUNTER",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 1200,
-       },
-       {
-               .name = "Free",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Buffers",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Cached",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Active",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Inactive",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "SwapFree",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Anon",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Slab",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Tables",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {
-               .name = "Swap",
-               .type = "GAUGE",
-               .heartbeat = 240,
-               .min = 0,
-               .max = 32768,
-       },
-       {},
+static struct rrd_image *temp_images[] = {
+       &sensor2_daily,
+       &sensor2_weekly,
+       &sensor2_monthly,
+       &sensor2_yearly,
+       &sensor3_daily,
+       &sensor3_weekly,
+       &sensor3_monthly,
+       &sensor3_yearly,
+       0,
 };
 
-struct rrd_archive cpumem_archives[] = {
-       {
-               .type = "AVERAGE",
-               .xff = 0.5,
-               .steps = 1,
-               .rows = 720,
-       },
-       {
-               .type = "AVERAGE",
-               .xff = 0.5,
-               .steps = 7,
-               .rows = 720,
-       },
-       {
-               .type = "AVERAGE",
-               .xff = 0.5,
-               .steps = 31,
-               .rows = 720,
-       },
-       {
-               .type = "AVERAGE",
-               .xff = 0.5,
-               .steps = 365,
-               .rows = 720,
-       },
-       {
-               .type = "MIN",
-               .xff = 0.5,
-               .steps = 1,
-               .rows = 720,
-       },
-       {
-               .type = "MIN",
-               .xff = 0.5,
-               .steps = 7,
-               .rows = 720,
-       },
-       {
-               .type = "MIN",
-               .xff = 0.5,
-               .steps = 31,
-               .rows = 720,
-       },
-       {
-               .type = "MIN",
-               .xff = 0.5,
-               .steps = 365,
-               .rows = 720,
-       },
-       {
-               .type = "MAX",
-               .xff = 0.5,
-               .steps = 1,
-               .rows = 720,
-       },
-       {
-               .type = "MAX",
-               .xff = 0.5,
-               .steps = 7,
-               .rows = 720,
-       },
-       {
-               .type = "MAX",
-               .xff = 0.5,
-               .steps = 31,
-               .rows = 720,
-       },
-       {
-               .type = "MAX",
-               .xff = 0.5,
-               .steps = 365,
-               .rows = 720,
-       },
-       {},
+static struct rrd_image *hdcpu_images[] = {
+       &hdcpu_daily,
+       &hdcpu_weekly,
+       &hdcpu_monthly,
+       &hdcpu_yearly,
+       0,
 };
 
 static struct rrd_database cpumem_rrd = {
@@ -453,23 +325,31 @@ static struct rrd_database cpumem_rrd = {
        .interval       = 120,
        .parse          = cpu_mem_parser,
        .images         = (struct rrd_image **)&cpu_mem_images,
-       .sources        = cpumem_sources,
-       .archives       = cpumem_archives,
-       .name           = "cpumem",
+       .name           = "cpumem"
 };
 
-static struct rrd_database systemp_rrd = {
+static struct rrd_database digitemp_rrd = {
+       .filename       = DIGITEMP_RRD_PATH,
        .interval       = 300,
-       .parse          = NULL,
-       .filename       = NULL,
-       .images         = (struct rrd_image **)&systemp_images,
-       .name           = "systemp",
+       .parse          = digitemp_parser_mod,
+       .images         = (struct rrd_image **)&temp_images,
+       .name           = "digitemp",
 };
 
+static struct rrd_database hdtemp_rrd = {
+       .filename       = HDTEMP_RRD_PATH,
+       .interval       = 300,
+       .parse          = 0,
+       .images         = (struct rrd_image **)&hdcpu_images,
+       .name           = "hdtemp",
+};
+
+
 static struct rrd_database *all_rrds[] = {
        &cpumem_rrd,
-       &systemp_rrd,
-       0
+       &digitemp_rrd,
+       &hdtemp_rrd,
+       0,
 };
 
 #endif