#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",
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 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",
+ 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",
+ 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 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",
+ 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",
+ 0
+};
+
const char *systemptext[] = {
"DEF:sda_c=" SYSTEMP_RRD_PATH ":sda:AVERAGE",
"DEF:SYS_c=" SYSTEMP_RRD_PATH ":SYS:AVERAGE",
0
};
+const char *eth0options[] = {
+ "--alt-autoscale",
+ "--vertical-label", "Bytes",
+ 0
+};
+
+const char *eth1options[] = {
+ "--alt-autoscale",
+ "--vertical-label", "Bytes",
+ 0
+};
+
const char *systempoptions[] = {
"--alt-autoscale",
"--vertical-label", "Temp °C",
const char *freqoptions[] = {
"--alt-autoscale",
"--vertical-label", "Taajuus Hz",
- "--units-exponent", "-2",
+ "--units-exponent", "-3",
0
};
const char *deviationoptions[] = {
"--alt-autoscale",
"--vertical-label", "Aikapoikkeama s",
- "--units-exponent", "-2",
+ "--units-exponent", "-3",
0
};
DEFINE_IMAGE(freq, "/home/kaapeli/rrdd/power/images/freq", 480, 240);
DEFINE_IMAGE(deviation, "/home/kaapeli/rrdd/power/images/deviation", 480, 240);
DEFINE_IMAGE(price, "/home/kaapeli/rrdd/power/images/price", 480, 240);
+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,
0
};
+static struct rrd_image *network_images[] = {
+ ð0daily,
+ ð0weekly,
+ ð0monthly,
+ ð0yearly,
+ ð1daily,
+ ð1weekly,
+ ð1monthly,
+ ð1yearly,
+ NULL,
+};
+
static struct rrd_image *systemp_images[] = {
&systempdaily,
&systempweekly,
{},
};
+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)
+ {},
+};
+
struct rrd_data_source power_sources[] = {
SOURCE_ENTRY("kulutus", "GAUGE", 360, 0, 3000)
SOURCE_ENTRY("tuotanto", "GAUGE", 360, 0, 3000)
.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,
+};
+
static struct rrd_database *all_rrds[] = {
&cpumem_rrd,
- &systemp_rrd,
&power_rrd,
+ &network_rrd,
0
};