]> git.ipfire.org Git - collecty.git/commitdiff
module: Call RRD tool to create a new database
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 09:53:48 +0000 (09:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 09:53:48 +0000 (09:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/module.c

index e1da92334cc2174a7b915d0cf631882e913191a8..cabb5322c442b8f1b925e5a213368b2181a4b312 100644 (file)
@@ -315,6 +315,13 @@ static int collecty_module_create_database(collecty_module* self, const char* pa
        if (r < 0)
                goto ERROR;
 
+       // Create the RRD file
+       r = rrd_create_r(path, STEPSIZE, 0, collecty_args_argc(args), collecty_args_argv(args));
+       if (r < 0) {
+               ERROR(self->ctx, "Failed to create %s: %s\n", path, rrd_get_error());
+               r = -EINVAL;
+       }
+
 ERROR:
        if (args)
                collecty_args_unref(args);