src/daemon/graphs/pressure.h \
src/daemon/graphs/processor.c \
src/daemon/graphs/processor.h \
+ src/daemon/graphs/processor-temperature.c \
+ src/daemon/graphs/processor-temperature.h \
src/daemon/graphs/unbound-cache-performance.c \
src/daemon/graphs/unbound-cache-performance.h \
src/daemon/graphs/unbound-cache-usage.c \
// Temperature
#define COLOR_TEMPERATURE COLOR_COOL_GREY
+#define COLOR_TEMP_MAXIMUM COLOR_LIMIT
+#define COLOR_TEMP_CRITICAL COLOR_MAXIMUM
// Networking
#define COLOR_IPV6 COLOR_VIVID_VIOLET
#include "graphs/memory.h"
#include "graphs/pressure.h"
#include "graphs/processor.h"
+#include "graphs/processor-temperature.h"
#include "graphs/unbound-cache-performance.h"
#include "graphs/unbound-cache-usage.h"
#include "graphs/unbound-memory-usage.h"
&hostapd_station_signal_graph,
&loadavg_graph,
&memory_graph,
- &processor_graph,
&uptime_graph,
+ // Processor
+ &processor_graph,
+ &processor_temperature_graph,
+
// Disk
&disk_io_graph,
&disk_temp_graph,
PRINT_CAMM(args, FIELD_FAHRENHEIT(field), object, FAHRENHEIT); \
} while (0)
+#define DRAW_TEMPERATURE_MAXIMUM(args, options, field, object) \
+ do { \
+ switch (td_graph_temperature(options)) { \
+ case TD_GRAPH_TEMP_KELVIN: \
+ DRAW_TEMPERATURE_MAXIMUM_K(args, field, object); \
+ break; \
+ \
+ case TD_GRAPH_TEMP_CELSIUS: \
+ DRAW_TEMPERATURE_MAXIMUM_C(args, field, object); \
+ break; \
+ \
+ case TD_GRAPH_TEMP_FAHRENHEIT: \
+ DRAW_TEMPERATURE_MAXIMUM_F(args, field, object); \
+ break; \
+ } \
+ } while (0)
+
+#define DRAW_TEMPERATURE_MAXIMUM_K(args, field, object) \
+ do { \
+ DRAW_LINE(args, 1, field, object, COLOR_TEMP_MAXIMUM, DASHED|SKIPSCALE); \
+ } while (0)
+
+#define DRAW_TEMPERATURE_MAXIMUM_C(args, field, object) \
+ do { \
+ COMPUTE_CELSIUS(args, field, object); \
+ DRAW_LINE(args, 1, FIELD_CELSIUS(field), object, COLOR_TEMP_MAXIMUM, DASHED|SKIPSCALE); \
+ } while (0)
+
+#define DRAW_TEMPERATURE_MAXIMUM_F(args, field, object) \
+ do { \
+ COMPUTE_FAHRENHEIT(args, field, object); \
+ DRAW_LINE(args, 1, FIELD_FAHRENHEIT(field), object, COLOR_TEMP_MAXIMUM, DASHED|SKIPSCALE); \
+ } while (0)
+
+#define DRAW_TEMPERATURE_CRITICAL(args, options, field, object) \
+ do { \
+ switch (td_graph_temperature(options)) { \
+ case TD_GRAPH_TEMP_KELVIN: \
+ DRAW_TEMPERATURE_CRITICAL_K(args, field, object); \
+ break; \
+ \
+ case TD_GRAPH_TEMP_CELSIUS: \
+ DRAW_TEMPERATURE_CRITICAL_C(args, field, object); \
+ break; \
+ \
+ case TD_GRAPH_TEMP_FAHRENHEIT: \
+ DRAW_TEMPERATURE_CRITICAL_F(args, field, object); \
+ break; \
+ } \
+ } while (0)
+
+#define DRAW_TEMPERATURE_CRITICAL_K(args, field, object) \
+ do { \
+ DRAW_LINE(args, 1, field, object, COLOR_TEMP_CRITICAL, DASHED|SKIPSCALE); \
+ } while (0)
+
+#define DRAW_TEMPERATURE_CRITICAL_C(args, field, object) \
+ do { \
+ COMPUTE_CELSIUS(args, field, object); \
+ DRAW_LINE(args, 1, FIELD_CELSIUS(field), object, COLOR_TEMP_CRITICAL, DASHED|SKIPSCALE); \
+ } while (0)
+
+#define DRAW_TEMPERATURE_CRITICAL_F(args, field, object) \
+ do { \
+ COMPUTE_FAHRENHEIT(args, field, object); \
+ DRAW_LINE(args, 1, FIELD_FAHRENHEIT(field), object, COLOR_TEMP_CRITICAL, DASHED|SKIPSCALE); \
+ } while (0)
+
#endif /* TELEMETRY_GRAPHS_GRAPH_H */
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2026 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#include <limits.h>
+
+#include "../ctx.h"
+#include "../sensors.h"
+#include "../source.h"
+#include "../string.h"
+#include "graph.h"
+#include "processor-temperature.h"
+
+typedef struct processor_temperature_state {
+ td_graph* graph;
+ const td_graph_render_options* options;
+ td_args* args;
+} processor_temperature_state;
+
+const char* supported_sensors[] = {
+ // Intel
+ "coretemp-*",
+ // AMD
+ "k10temp-*",
+ "k8temp-*",
+ NULL,
+};
+
+static int processor_temperature_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Processor Temperature"));
+}
+
+static int processor_temperature_render_sensor(td_ctx* ctx, td_source* source,
+ const sensors_feature_type type, const sensors_chip_name* chip,
+ const sensors_feature* feature, void* data) {
+ const processor_temperature_state* state = data;
+ char name[NAME_MAX];
+ int r;
+
+ // Fetch the sensor name
+ r = td_sensors_name(name, chip, feature);
+ if (r < 0)
+ return 0;
+
+ // Skip if this is not a supported sensor
+ if (!td_string_matches_any(name, supported_sensors))
+ return 0;
+
+ // Add the source
+ r = td_graph_require_source(state->graph, state->args, "sensors-temp", name);
+ if (r < 0)
+ return r;
+
+ // Header
+ PRINT_HEADER4(state->args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ // Draw the temperature
+ DRAW_TEMPERATURE(state->args, state->options, "current", name, "%s", _("Temperature"));
+
+ // Draw the temperature limits
+ DRAW_TEMPERATURE_MAXIMUM(state->args, state->options, "max", name);
+ DRAW_TEMPERATURE_CRITICAL(state->args, state->options, "crit", name);
+
+ return 0;
+}
+
+static int processor_temperature_render(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, td_args* args, const char* object) {
+ processor_temperature_state state = {
+ .graph = graph,
+ .options = options,
+ .args = args,
+ };
+
+ // Walk through all temperature sensors
+ return td_sensors_walk(ctx, NULL, SENSORS_FEATURE_TEMP,
+ processor_temperature_render_sensor, &state);
+}
+
+const td_graph_impl processor_temperature_graph = {
+ .name = "ProcessorTemperature",
+ .render = processor_temperature_render,
+ .title = processor_temperature_title,
+ .vlabel = td_graph_vlabel_temp,
+
+ // Limits
+ .lower_limit = 0,
+ .upper_limit = LONG_MAX,
+};
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2026 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef TELEMETRY_GRAPH_PROCESSOR_TEMPERATURE_H
+#define TELEMETRY_GRAPH_PROCESSOR_TEMPERATURE_H
+
+#include "../graph.h"
+
+extern const td_graph_impl processor_temperature_graph;
+
+#endif /* TELEMETRY_GRAPH_PROCESSOR_TEMPERATURE_H */