*** ./xymond/rrd/do_temperature.c.orig 2019-04-17 17:56:30.000000000 -0600 --- ./xymond/rrd/do_temperature.c 2019-08-06 16:31:39.858831000 -0600 *************** *** 40,48 **** &green temp1 37 98 ----------------------------------------------------- */ ! static char temperature_rcsid[] = "$Id: do_temperature.c 8050 2019-04-17 23:56:30Z jccleaver $"; int do_temperature_rrd(char *hostname, char *testname, char *classname, char *pagepaths, char *msg, time_t tstamp) { --- 40,61 ---- &green temp1 37 98 ----------------------------------------------------- + Device Temp(C) Temp(F) Lo(C) LoWarn(C) HiWarn(C) Hi(C) + ------------------------------------------------------------------------------- + &green CPU 0 Die 79 174 (-10 0 88 90) + &green CPU 0 Ambient 23 73 (-10 0 40 60) + ------------------------------------------------------------------------------- + + Device Temp(C) Temp(F) Threshold(C) + ------------------------------------------------------ + &green System Board Inlet Temp 21 69 ( 42) + &green CPU1 Temp 32 89 ( 93) + &green CPU2 Temp 31 87 ( 93) + ------------------------------------------------------ + */ ! static char temperature_rcsid[] = "$Id: do_temperature.c 8050 2019-04-17 23:56:30Z jccleaver, patched 2019-08-06 TSchmidt $"; int do_temperature_rrd(char *hostname, char *testname, char *classname, char *pagepaths, char *msg, time_t tstamp) { *************** *** 50,56 **** NULL }; static void *temperature_tpl = NULL; ! char *bol, *eol, *p; int tmpC; if (temperature_tpl == NULL) temperature_tpl = setup_template(temperature_params); --- 63,69 ---- NULL }; static void *temperature_tpl = NULL; ! char *bol, *eol, *comment, *p; int tmpC; if (temperature_tpl == NULL) temperature_tpl = setup_template(temperature_params); *************** *** 62,67 **** --- 75,85 ---- bol = p + 1; eol = strchr(bol, '\n'); if (eol) *eol = '\0'; + /* See if there's a comment in parenthesis */ + comment = strchr(bol, '('); /* Begin comment */ + p = strchr(bol, ')'); /* End comment */ + if (comment && p && (comment < p)) *comment = '\0'; /* Cut off the comment */ + if (strncmp(bol, "&green", 6) == 0) { bol += 6; gotone = 1; } else if (strncmp(bol, "&yellow", 7) == 0) { bol += 7; gotone = 1; } else if (strncmp(bol, "&red", 4) == 0) { bol += 4; gotone = 1; } *************** *** 70,75 **** --- 88,99 ---- if (gotone) { char savech; + /* Strip off any leading bold and italic HTML tags */ + if (strncasecmp(bol, "", 6) == 0) { bol += 6; } + else if (strncasecmp(bol, "", 3) == 0) { bol += 3; } + else if (strncasecmp(bol, "", 6) == 0) { bol += 6; } + else if (strncasecmp(bol, "", 3) == 0) { bol += 3; } + bol += strspn(bol, " \t"); p = strstr(bol, "\t"); *************** *** 83,88 **** --- 107,113 ---- create_and_update_rrd(hostname, testname, classname, pagepaths, temperature_params, temperature_tpl); } + if (comment) *comment = '('; if (eol) *eol = '\n'; }