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

diff --git a/database.h b/database.h
deleted file mode 100644 (file)
index ba54acf..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-#ifndef _TESTDATA_H
-#define _TESTDATA_H
-
-#include "rrdtool.h"
-#include "scheduler.h"
-#include "parser.h"
-
-const char blank[] = "COMMENT:       ";
-#define numfmt " % 8.2lf "
-
-#define SYSINFO_PATH           "/home/kaapeli/rrdd/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 NETWORK_RRD_PATH       SYSINFO_PATH "network.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 *eth0text[] = {
-       "DEF:rxb=" NETWORK_RRD_PATH ":eth0rxb:AVERAGE",
-       "DEF:txb=" NETWORK_RRD_PATH ":eth0txb:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                          "
-       "MIN            MAX             AVG             Last\\n",
-       blank,
-       "LINE1:rxb#0000FF:eth0 receive     ",
-       "GPRINT:rxb:MIN:  % 3.2lf %sB",
-       "GPRINT:rxb:MAX:     % 3.2lf %sB",
-       "GPRINT:rxb:AVERAGE:      % 3.2lf %sB",
-       "GPRINT:rxb:LAST:      % 3.2lf %sB\\n",
-       blank,
-       "LINE1:txb#00FF00:eth0 transmit    ",
-       "GPRINT:txb:MIN:  % 3.2lf %sB",
-       "GPRINT:txb:MAX:     % 3.2lf %sB",
-       "GPRINT:txb:AVERAGE:      % 3.2lf %sB",
-       "GPRINT:txb:LAST:      % 3.2lf %sB\\n",
-       "COMMENT: \\n",
-       0
-};
-
-const char *eth1text[] = {
-       "DEF:rxb=" NETWORK_RRD_PATH ":eth1rxb:AVERAGE",
-       "DEF:txb=" NETWORK_RRD_PATH ":eth1txb:AVERAGE",
-       "COMMENT:\\n",
-       blank,
-       "COMMENT:                          "
-       "MIN            MAX             AVG             Last\\n",
-       blank,
-       "LINE1:rxb#0000FF:eth1 receive     ",
-       "GPRINT:rxb:MIN:  % 3.2lf %sB",
-       "GPRINT:rxb:MAX:     % 3.2lf %sB",
-       "GPRINT:rxb:AVERAGE:      % 3.2lf %sB",
-       "GPRINT:rxb:LAST:      % 3.2lf %sB\\n",
-       blank,
-       "LINE1:txb#00FF00:eth1 transmit    ",
-       "GPRINT:txb:MIN:  % 3.2lf %sB",
-       "GPRINT:txb:MAX:     % 3.2lf %sB",
-       "GPRINT:txb:AVERAGE:      % 3.2lf %sB",
-       "GPRINT:txb:LAST:      % 3.2lf %sB\\n",
-       "COMMENT: \\n",
-       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",
-       "COMMENT:\\n",
-       blank,
-       "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",
-       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",
-       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", 
-       "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",
-       "--base", "1024",
-       0
-};
-
-const char *eth0options[] = {
-       "--alt-autoscale-max",
-       "--vertical-label", "Bytes",
-       "--lower-limit", "0",
-       0
-};
-
-const char *eth1options[] = {
-       "--alt-autoscale-max",
-       "--vertical-label", "Bytes",
-       "--lower-limit", "0",
-       0
-};
-
-const char *systempoptions[] = {
-       "--alt-autoscale",
-       "--vertical-label", "Temp °C",
-       0
-};
-
-#define xstr(s) str(s)
-#define str(s) #s
-
-#define DEFINE_IMAGE(rrdname, _filename, _width, _height)              \
-       static struct rrd_image rrdname ## daily = {                    \
-               .image_filename = _filename "_daily.png",               \
-               .width = _width,                                        \
-               .height = _height,                                      \
-               .timestart = "end-1d",                                  \
-               .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-1w",                                  \
-               .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-1m",                                  \
-               .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-1y",                                  \
-               .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);
-
-static struct rrd_image *cpu_mem_images[] = {
-       &cpudaily,
-       &cpuweekly,
-       &cpumonthly,
-       &cpuyearly,
-       &memdaily,
-       &memweekly,
-       &memmonthly,
-       &memyearly,
-       0
-};
-
-static struct rrd_image *network_images[] = {
-       &eth0daily,
-       &eth0weekly,
-       &eth0monthly,
-       &eth0yearly,
-       &eth1daily,
-       &eth1weekly,
-       &eth1monthly,
-       &eth1yearly,
-       NULL,
-};
-
-static struct rrd_image *systemp_images[] = {
-       &systempdaily,
-       &systempweekly,
-       &systempmonthly,
-       &systempyearly,
-       0
-};
-
-#define SOURCE_ENTRY(_name, _type, _heartbeat, _min, _max) \
-       {                                                  \
-               .name = _name,                             \
-               .type = _type,                             \
-               .heartbeat = _heartbeat,                   \
-               .min = _min,                               \
-               .max = _max,                               \
-       },
-
-#define ARCHIVE_ENTRY(_type, _xff, _steps, _rows) \
-       {                                         \
-               .type = _type,                    \
-               .xff = _xff,                      \
-               .steps = _steps,                  \
-               .rows = _rows,                    \
-       },
-
-struct rrd_data_source cpumem_sources[] = {
-       SOURCE_ENTRY("User",    "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("Nice",    "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("Sys",     "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("Idle",    "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("Wait",    "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("IRQ",     "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("SoftIRQ", "COUNTER", 240, 0, 1200)
-       SOURCE_ENTRY("Free",    "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Buffers", "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Cached",  "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Active",  "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Inactive","GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("SwapFree","GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Anon",    "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Slab",    "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Tables",  "GAUGE", 240, 0, 32768)
-       SOURCE_ENTRY("Swap",    "GAUGE", 240, 0, 32768)
-       {},
-};
-
-struct rrd_archive cpumem_archives[] = {
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 1, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 7, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 31, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 365, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 1, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 7, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 31, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 365, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 1, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 7, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 31, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 365, 720)
-       {},
-};
-
-struct rrd_data_source network_sources[] = {
-       SOURCE_ENTRY("eth0rxb", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth0rxp", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth0txb", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth0txp", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth1rxb", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth1rxp", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth1txb", "COUNTER", 240, 0, 120000000000)
-       SOURCE_ENTRY("eth1txp", "COUNTER", 240, 0, 120000000000)
-       {},
-};
-
-struct rrd_archive network_archives[] = {
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 1, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 7, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 31, 720)
-       ARCHIVE_ENTRY("AVERAGE", 0.5, 365, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 1, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 7, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 31, 720)
-       ARCHIVE_ENTRY("MIN", 0.5, 365, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 1, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 7, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 31, 720)
-       ARCHIVE_ENTRY("MAX", 0.5, 365, 720)
-       {},
-};
-
-static struct rrd_database cpumem_rrd = {
-       .filename       = SYSINFO_RRD_PATH,
-       .interval       = 120,
-       .parse          = cpu_mem_parser,
-       .images         = (struct rrd_image **)&cpu_mem_images,
-       .sources        = cpumem_sources,
-       .archives       = cpumem_archives,
-       .name           = "cpumem",
-};
-
-static struct rrd_database systemp_rrd = {
-       .interval       = 300,
-       .parse          = NULL,
-       .filename       = NULL,
-       .images         = (struct rrd_image **)&systemp_images,
-       .name           = "systemp",
-};
-
-char *network_interfaces[] = {
-       "eth0",
-       "eth1",
-       NULL,
-};
-
-static struct rrd_database network_rrd = {
-       .name           = "network",
-       .filename       = NETWORK_RRD_PATH,
-       .interval       = 120,
-       .parse          = netstats_parser,
-       .sources        = network_sources,
-       .archives       = network_archives,
-       .parser_data    = network_interfaces,
-       .images         = network_images,
-};
-
-#include "power_database.h"
-
-static struct rrd_database *all_rrds[] = {
-       &cpumem_rrd,
-       &power_rrd,
-       &network_rrd,
-       0
-};
-
-#endif
index 80788708787b056c0abc4f627b3d24079394b208..ba54acf74bc68a35c798c6e4efe9fd4cd4692a77 100644 (file)
@@ -140,17 +140,18 @@ const char *eth0text[] = {
        "COMMENT:                          "
        "MIN            MAX             AVG             Last\\n",
        blank,
-       "LINE1:rxb#0000FF:eth0 rx bytes        ",
-       "GPRINT:rxb:MIN:  %5.0lf B",
-       "GPRINT:rxb:MAX:     %5.0lf B",
-       "GPRINT:rxb:AVERAGE:      %5.0lf B",
-       "GPRINT:rxb:LAST:      %5.0lf B\\n",
+       "LINE1:rxb#0000FF:eth0 receive     ",
+       "GPRINT:rxb:MIN:  % 3.2lf %sB",
+       "GPRINT:rxb:MAX:     % 3.2lf %sB",
+       "GPRINT:rxb:AVERAGE:      % 3.2lf %sB",
+       "GPRINT:rxb:LAST:      % 3.2lf %sB\\n",
        blank,
-       "LINE1:txb#00FF00:eth0 tx bytes        ",
-       "GPRINT:txb:MIN:  %5.0lf B",
-       "GPRINT:txb:MAX:     %5.0lf B",
-       "GPRINT:txb:AVERAGE:      %5.0lf B",
-       "GPRINT:txb:LAST:      %5.0lf B\\n",
+       "LINE1:txb#00FF00:eth0 transmit    ",
+       "GPRINT:txb:MIN:  % 3.2lf %sB",
+       "GPRINT:txb:MAX:     % 3.2lf %sB",
+       "GPRINT:txb:AVERAGE:      % 3.2lf %sB",
+       "GPRINT:txb:LAST:      % 3.2lf %sB\\n",
+       "COMMENT: \\n",
        0
 };
 
@@ -162,17 +163,18 @@ const char *eth1text[] = {
        "COMMENT:                          "
        "MIN            MAX             AVG             Last\\n",
        blank,
-       "LINE1:rxb#0000FF:eth1 rx bytes        ",
-       "GPRINT:rxb:MIN:  %5.0lf B",
-       "GPRINT:rxb:MAX:     %5.0lf B",
-       "GPRINT:rxb:AVERAGE:      %5.0lf B",
-       "GPRINT:rxb:LAST:      %5.0lf B\\n",
+       "LINE1:rxb#0000FF:eth1 receive     ",
+       "GPRINT:rxb:MIN:  % 3.2lf %sB",
+       "GPRINT:rxb:MAX:     % 3.2lf %sB",
+       "GPRINT:rxb:AVERAGE:      % 3.2lf %sB",
+       "GPRINT:rxb:LAST:      % 3.2lf %sB\\n",
        blank,
-       "LINE1:txb#00FF00:eth1 tx bytes        ",
-       "GPRINT:txb:MIN:  %5.0lf B",
-       "GPRINT:txb:MAX:     %5.0lf B",
-       "GPRINT:txb:AVERAGE:      %5.0lf B",
-       "GPRINT:txb:LAST:      %5.0lf B\\n",
+       "LINE1:txb#00FF00:eth1 transmit    ",
+       "GPRINT:txb:MIN:  % 3.2lf %sB",
+       "GPRINT:txb:MAX:     % 3.2lf %sB",
+       "GPRINT:txb:AVERAGE:      % 3.2lf %sB",
+       "GPRINT:txb:LAST:      % 3.2lf %sB\\n",
+       "COMMENT: \\n",
        0
 };
 
@@ -220,18 +222,21 @@ const char *memoptions[] = {
        "--vertical-label",
        "Mem usage (MB)",
        "--units-exponent", "0",
+       "--base", "1024",
        0
 };
 
 const char *eth0options[] = {
-       "--alt-autoscale",
+       "--alt-autoscale-max",
        "--vertical-label", "Bytes",
+       "--lower-limit", "0",
        0
 };
 
 const char *eth1options[] = {
-       "--alt-autoscale",
+       "--alt-autoscale-max",
        "--vertical-label", "Bytes",
+       "--lower-limit", "0",
        0
 };
 
@@ -241,6 +246,9 @@ const char *systempoptions[] = {
        0
 };
 
+#define xstr(s) str(s)
+#define str(s) #s
+
 #define DEFINE_IMAGE(rrdname, _filename, _width, _height)              \
        static struct rrd_image rrdname ## daily = {                    \
                .image_filename = _filename "_daily.png",               \
@@ -321,7 +329,6 @@ static struct rrd_image *systemp_images[] = {
        0
 };
 
-
 #define SOURCE_ENTRY(_name, _type, _heartbeat, _min, _max) \
        {                                                  \
                .name = _name,                             \
@@ -439,9 +446,11 @@ static struct rrd_database network_rrd = {
        .images         = network_images,
 };
 
+#include "power_database.h"
+
 static struct rrd_database *all_rrds[] = {
        &cpumem_rrd,
-       &systemp_rrd,
+       &power_rrd,
        &network_rrd,
        0
 };