#include "parser.h"
const char blank[] = "COMMENT: ";
+#define tempfmt "% 6.2lf °C"
+
#define numfmt " % 8.2lf "
-#define SYSINFO_PATH "./"
+#define SYSINFO_PATH "/home/kaapeli/sysinfo/"
#define SYSINFO_RRD_PATH SYSINFO_PATH "sysinfo.rrd"
#define SYSINFO_IMAGES_PATH SYSINFO_PATH "images/"
++#define TEMP_IMAGES_PATH "/home/apache2/temperature/"
-#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"
#define NETWORK_RRD_PATH SYSINFO_PATH "network.rrd"
.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(eth0, "/home/kaapeli/sysinfo/images/eth0", 720, 200, 1);
- DEFINE_IMAGE(eth1, "/home/kaapeli/sysinfo/images/eth1", 720, 200, 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);
-DEFINE_IMAGE(cpu, SYSINFO_PATH "/images/cpu", 720, 480, 1);
-DEFINE_IMAGE(mem, SYSINFO_PATH "/images/mem", 720, 480, 1);
-DEFINE_IMAGE(systemp, SYSINFO_PATH "/images/systemp", 720,480,1);
-DEFINE_IMAGE(eth0, SYSINFO_PATH "/images/eth0", 720, 200, 1);
-DEFINE_IMAGE(eth1, SYSINFO_PATH "/images/eth1", 720, 200, 1);
++DEFINE_IMAGE(cpu, SYSINFO_IMAGES_PATH "cpu", 720, 480, 1);
++DEFINE_IMAGE(mem, SYSINFO_IMAGES_PATH "mem", 720, 480, 1);
++DEFINE_IMAGE(eth0, SYSINFO_IMAGES_PATH "eth0", 720, 200, 1);
++DEFINE_IMAGE(eth1, SYSINFO_IMAGES_PATH "eth1", 720, 200, 1);
++DEFINE_IMAGE(sensor2_, TEMP_IMAGES_PATH "sensor2", 600, 200, 2);
++DEFINE_IMAGE(sensor3_, TEMP_IMAGES_PATH "sensor1-3", 600, 200, 2);
++DEFINE_IMAGE(hdcpu_, TEMP_IMAGES_PATH "hdcpu", 600, 200, 2);
static struct rrd_image *cpu_mem_images[] = {
&cpudaily,
.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",
+ .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 systemp_rrd = {
+static struct rrd_database hdtemp_rrd = {
+ .filename = HDTEMP_RRD_PATH,
.interval = 300,
- .parse = NULL,
- .filename = NULL,
- .images = (struct rrd_image **)&systemp_images,
- .name = "systemp",
+ .parse = 0,
+ .images = (struct rrd_image **)&hdcpu_images,
+ .name = "hdtemp",
};
char *network_interfaces[] = {