src/daemon/graphs/contextswitches.h \
src/daemon/graphs/cpufreq.c \
src/daemon/graphs/cpufreq.h \
+ src/daemon/graphs/disk.c \
+ src/daemon/graphs/disk.h \
src/daemon/graphs/graph.h \
src/daemon/graphs/hostapd-station-bandwidth.c \
src/daemon/graphs/hostapd-station-bandwidth.h \
#define COLOR_RX "#43a047"
#define COLOR_TX "#fb8c00"
+// Caches
#define COLOR_CACHE_HIT COLOR_GREEN
#define COLOR_CACHE_MISS COLOR_RED
+// Temperature
+#define COLOR_TEMPERATURE COLOR_RED
+
// CPU Colors
static inline const char* COLOR_CPU(long i) {
#include "graphs/conntrack.h"
#include "graphs/contextswitches.h"
#include "graphs/cpufreq.h"
+#include "graphs/disk.h"
#include "graphs/hostapd-station-bandwidth.h"
#include "graphs/hostapd-station-rate-info.h"
#include "graphs/hostapd-station-signal.h"
&conntrack_graph,
&contextswitches_graph,
&cpufreq_graph,
+ &disk_temp_graph,
&hostapd_station_bandwidth_graph,
&hostapd_station_rate_info_graph,
&hostapd_station_signal_graph,
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 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 "graph.h"
+#include "disk.h"
+
+static int disk_temp_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Disk Temperature"));
+}
+
+static int disk_temp_render(td_ctx* ctx,
+ td_graph* graph, td_args* args, const char* object) {
+ int r;
+
+ // Load all sources
+ r = td_graph_require_source(graph, args, "disk", object);
+ if (r < 0)
+ return r;
+
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ // Draw the temperature
+ DRAW_TEMPERATURE_KELVIN(args, "temperature", object, "%s", _("Temperature"));
+
+ return 0;
+}
+
+const td_graph_impl disk_temp_graph = {
+ .name = "DiskTemperature",
+ .render = disk_temp_render,
+ .title = disk_temp_title,
+ //.vlabel = td_graph_vlabel_qps,
+
+ // Limits
+ .lower_limit = -LONG_MAX,
+ .upper_limit = LONG_MAX,
+};
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 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_DISK_H
+#define TELEMETRY_GRAPH_DISK_H
+
+#include "../graph.h"
+
+extern const td_graph_impl disk_temp_graph;
+
+#endif /* TELEMETRY_GRAPH_DISK_H */
#define SECONDS_HIGHRES "%%12.2lf%%ss"
#define SECONDS "%%13.2lfs"
+// Temperatures
+#define KELVIN "%%12.2lf K"
+
// Macro to terminate a line
#define EOL "\\j"
PRINT_CAMM(args, bytes, object, BPS); \
} while (0)
+/*
+ This draws a temperature graph
+*/
+#define DRAW_TEMPERATURE_KELVIN(args, field, object, ...) \
+ do { \
+ DRAW_LINE_WITH_LABEL(args, 1, field, object, COLOR_TEMPERATURE, 0, ##__VA_ARGS__); \
+ PRINT_CAMM(args, field, object, KELVIN); \
+ } while (0)
+
#endif /* TELEMETRY_GRAPHS_GRAPH_H */