]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
[collectd 6] exec: add PUTMETRIC command
authorLeonard Göhrs <l.goehrs@pengutronix.de>
Thu, 5 Jan 2023 09:11:23 +0000 (10:11 +0100)
committerMatthias Runge <mrunge@matthias-runge.de>
Sun, 23 Apr 2023 13:00:45 +0000 (15:00 +0200)
Most existing setups using exec will use PUTVAL, which should just continue
to work with collectd 6 due to the plugin_dispatch_values compatibility
function.
New plugins should however use the new PUTMETRIC.
The respective command handler already exists. This commit just pipes it
through.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
src/exec.c

index 64c1e952fa4050b4706148df95174bef962642e3..61eb8bc5fe454368b00b6380a2a807698dbf579b 100644 (file)
@@ -34,6 +34,7 @@
 #include "plugin.h"
 #include "utils/common/common.h"
 
+#include "utils/cmds/putmetric.h"
 #include "utils/cmds/putnotif.h"
 #include "utils/cmds/putval.h"
 
@@ -558,6 +559,8 @@ static int parse_line(char *buffer) /* {{{ */
 {
   if (strncasecmp("PUTVAL", buffer, strlen("PUTVAL")) == 0)
     return cmd_handle_putval(stdout, buffer);
+  else if (strncasecmp("PUTMETRIC", buffer, strlen("PUTMETRIC")) == 0)
+    return cmd_handle_putmetric(stdout, buffer);
   else if (strncasecmp("PUTNOTIF", buffer, strlen("PUTNOTIF")) == 0)
     return handle_putnotif(stdout, buffer);
   else {