const char blank[] = "COMMENT: ";
#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 SYSTEMP_RRD_PATH "/root/systemp/systemp.rrd"
+
const char *cputext[] = {
- "DEF:us=/home/kaapeli/sysinfo/sysinfo.rrd:User:AVERAGE",
- "DEF:ni=/home/kaapeli/sysinfo/sysinfo.rrd:Nice:AVERAGE",
- "DEF:sy=/home/kaapeli/sysinfo/sysinfo.rrd:Sys:AVERAGE",
- "DEF:id=/home/kaapeli/sysinfo/sysinfo.rrd:Idle:AVERAGE",
- "DEF:wa=/home/kaapeli/sysinfo/sysinfo.rrd:Wait:AVERAGE",
- "DEF:in=/home/kaapeli/sysinfo/sysinfo.rrd:IRQ:AVERAGE",
- "DEF:so=/home/kaapeli/sysinfo/sysinfo.rrd:SoftIRQ:AVERAGE",
+ "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: "
};
const char *memtext[] = {
- "DEF:fr=/home/kaapeli/sysinfo/sysinfo.rrd:Free:AVERAGE",
- "DEF:bu=/home/kaapeli/sysinfo/sysinfo.rrd:Buffers:AVERAGE",
- "DEF:ca=/home/kaapeli/sysinfo/sysinfo.rrd:Cached:AVERAGE",
- "DEF:an=/home/kaapeli/sysinfo/sysinfo.rrd:Anon:AVERAGE",
- "DEF:sl=/home/kaapeli/sysinfo/sysinfo.rrd:Slab:AVERAGE",
- "DEF:ta=/home/kaapeli/sysinfo/sysinfo.rrd:Tables:AVERAGE",
- "DEF:sw=/home/kaapeli/sysinfo/sysinfo.rrd:Swap:AVERAGE",
+ "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: "
};
const char *systemptext[] = {
- "DEF:sda_c=/root/systemp/systemp.rrd:sda:AVERAGE",
- "DEF:SYS_c=/root/systemp/systemp.rrd:SYS:AVERAGE",
- "DEF:CPU_c=/root/systemp/systemp.rrd:CPU:AVERAGE",
+ "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: "
};
static struct rrd_image cpudaily = {
- .image_filename = "/home/kaapeli/sysinfo/images/cpu_daily.png",
+ .image_filename = SYSINFO_IMAGES_PATH "cpu_daily.png",
.width = 720,
.height = 480,
.timestart = "end-1d",
};
static struct rrd_image cpuweekly = {
- .image_filename = "/home/kaapeli/sysinfo/images/cpu_weekly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "cpu_weekly.png",
.width = 720,
.height = 480,
.timestart = "end-1w",
};
static struct rrd_image cpumonthly = {
- .image_filename = "/home/kaapeli/sysinfo/images/cpu_monthly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "cpu_monthly.png",
.width = 720,
.height = 480,
.timestart = "end-1m",
};
static struct rrd_image cpuyearly = {
- .image_filename = "/home/kaapeli/sysinfo/images/cpu_yearly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "cpu_yearly.png",
.width = 720,
.height = 480,
.timestart = "end-1y",
};
static struct rrd_image memdaily = {
- .image_filename = "/home/kaapeli/sysinfo/images/mem_daily.png",
+ .image_filename = SYSINFO_IMAGES_PATH "mem_daily.png",
.width = 720,
.height = 480,
.timestart = "end-1d",
};
static struct rrd_image memweekly = {
- .image_filename = "/home/kaapeli/sysinfo/images/mem_weekly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "mem_weekly.png",
.width = 720,
.height = 480,
.timestart = "end-1w",
.text = (char **)&memtext
};
static struct rrd_image memmonthly = {
- .image_filename = "/home/kaapeli/sysinfo/images/mem_monthly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "mem_monthly.png",
.width = 720,
.height = 480,
.timestart = "end-1m",
.text = (char **)&memtext
};
static struct rrd_image memyearly = {
- .image_filename = "/home/kaapeli/sysinfo/images/mem_yearly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "mem_yearly.png",
.width = 720,
.height = 480,
.timestart = "end-1y",
};
static struct rrd_image systempdaily = {
- .image_filename = "/home/kaapeli/sysinfo/images/systemp_daily.png",
+ .image_filename = SYSINFO_IMAGES_PATH "systemp_daily.png",
.width = 600,
.height = 200,
.timestart = "end-1d",
};
static struct rrd_image systempweekly = {
- .image_filename = "/home/kaapeli/sysinfo/images/systemp_weekly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "systemp_weekly.png",
.width = 600,
.height = 200,
.timestart = "end-1w",
};
static struct rrd_image systempmonthly = {
- .image_filename = "/home/kaapeli/sysinfo/images/systemp_monthly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "systemp_monthly.png",
.width = 600,
.height = 200,
.timestart = "end-1m",
};
static struct rrd_image systempyearly = {
- .image_filename = "/home/kaapeli/sysinfo/images/systemp_yearly.png",
+ .image_filename = SYSINFO_IMAGES_PATH "systemp_yearly.png",
.width = 600,
.height = 200,
.timestart = "end-1y",
};
static struct rrd_database cpumem_rrd = {
- .filename = "/home/kaapeli/sysinfo/sysinfo.rrd",
+ .filename = SYSINFO_RRD_PATH,
.interval = 120,
.parse = cpu_mem_parser,
.images = (struct rrd_image **)&cpu_mem_images,