#include "graphs/pressure.h"
#include "graphs/processor.h"
#include "graphs/processor-temperature.h"
+#include "graphs/system-temperature.h"
#include "graphs/unbound-cache-performance.h"
#include "graphs/unbound-cache-usage.h"
#include "graphs/unbound-memory-usage.h"
// Processor
&processor_graph,
- &processor_temperature_graph,
// Disk
&disk_io_graph,
&pressure_io_graph,
&pressure_memory_graph,
+ // Temperature
+ &processor_temperature_graph,
+ &system_temperature_graph,
+
// Unbound
&unbound_cache_performance_graph,
&unbound_cache_usage_graph,
--- /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 "system-temperature.h"
+
+static const char* supported_sensors[] = {
+ // ACPI
+ "acpitz-*",
+ NULL,
+};
+
+static int system_temperature_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("System Temperature"));
+}
+
+static int system_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 td_graph_render_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 system_temperature_render(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, td_args* args, const char* object) {
+ td_graph_render_state state = {
+ .graph = graph,
+ .options = options,
+ .args = args,
+ };
+
+ // Walk through all temperature sensors
+ return td_sensors_walk(ctx, NULL, SENSORS_FEATURE_TEMP,
+ system_temperature_render_sensor, &state);
+}
+
+const td_graph_impl system_temperature_graph = {
+ .name = "SystemTemperature",
+ .render = system_temperature_render,
+ .title = system_temperature_title,
+ .vlabel = td_graph_vlabel_temp,
+
+ // Limits
+ .lower_limit = -LONG_MAX,
+ .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_SYSTEM_TEMPERATURE_H
+#define TELEMETRY_GRAPH_SYSTEM_TEMPERATURE_H
+
+#include "../graph.h"
+
+extern const td_graph_impl system_temperature_graph;
+
+#endif /* TELEMETRY_GRAPH_SYSTEM_TEMPERATURE_H */