]> git.ipfire.org Git - collecty.git/commitdiff
modules: Create a dummy loadavg module
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 27 Sep 2025 12:55:26 +0000 (12:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 27 Sep 2025 12:55:26 +0000 (12:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/daemon/modules.c
src/daemon/modules/loadavg.c [new file with mode: 0644]
src/daemon/modules/loadavg.h [new file with mode: 0644]

index 724ae0972926028d4c633cd46d1e432d4f960d5f..2b6802c8dcc57032976a03179aaa98695cfc43ac 100644 (file)
@@ -99,7 +99,9 @@ dist_collectyd_SOURCES = \
        src/daemon/module.c \
        src/daemon/module.h \
        src/daemon/modules.c \
-       src/daemon/modules.h
+       src/daemon/modules.h \
+       src/daemon/modules/loadavg.c \
+       src/daemon/modules/loadavg.h
 
 collectyd_CPPFLAGS = \
        $(AM_CPPFLAGS)
index 8a4c1b0de8c707303db4c932c26ef802dd99c1db..9f21640360784db2853222a2e2aae34e8ae7b817 100644 (file)
 #include "module.h"
 #include "modules.h"
 
+// Load all modules
+#include "modules/loadavg.h"
+
 // Register all modules
 static collecty_module* modules[] = {
+       &loadavg_module,
        NULL,
 };
 
diff --git a/src/daemon/modules/loadavg.c b/src/daemon/modules/loadavg.c
new file mode 100644 (file)
index 0000000..641dfdc
--- /dev/null
@@ -0,0 +1,26 @@
+/*#############################################################################
+#                                                                             #
+# collecty - A system statistics collection daemon for IPFire                 #
+# 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 "../ctx.h"
+#include "loadavg.h"
+
+collecty_module loadavg_module = {
+       .name = "loadavg",
+};
diff --git a/src/daemon/modules/loadavg.h b/src/daemon/modules/loadavg.h
new file mode 100644 (file)
index 0000000..da9e30c
--- /dev/null
@@ -0,0 +1,28 @@
+/*#############################################################################
+#                                                                             #
+# collecty - A system statistics collection daemon for IPFire                 #
+# 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 COLLECTY_MODULE_LOADAVG_H
+#define COLLECTY_MODULE_LOADAVG_H
+
+#include "../module.h"
+
+extern collecty_module loadavg_module;
+
+#endif /* COLLECTY_MODULE_LOADAVG_H */