From: Michael Tremer Date: Sat, 27 Sep 2025 12:55:26 +0000 (+0000) Subject: modules: Create a dummy loadavg module X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9c4508d9fe74d7aa86fcef4a0c6952dabc85cd4;p=collecty.git modules: Create a dummy loadavg module Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 724ae09..2b6802c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) diff --git a/src/daemon/modules.c b/src/daemon/modules.c index 8a4c1b0..9f21640 100644 --- a/src/daemon/modules.c +++ b/src/daemon/modules.c @@ -24,8 +24,12 @@ #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 index 0000000..641dfdc --- /dev/null +++ b/src/daemon/modules/loadavg.c @@ -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 . # +# # +#############################################################################*/ + +#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 index 0000000..da9e30c --- /dev/null +++ b/src/daemon/modules/loadavg.h @@ -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 . # +# # +#############################################################################*/ + +#ifndef COLLECTY_MODULE_LOADAVG_H +#define COLLECTY_MODULE_LOADAVG_H + +#include "../module.h" + +extern collecty_module loadavg_module; + +#endif /* COLLECTY_MODULE_LOADAVG_H */