summaryrefslogtreecommitdiffstats
path: root/collectors/plugins.d
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2020-07-17 00:00:00 +0300
committerGitHub <noreply@github.com>2020-07-17 00:00:00 +0300
commit5871b37cf64d92f9ef7e89d0a3813c1c4bfcf203 (patch)
treee6b85a43db0999d9019320205a1c5deb1acbbeb0 /collectors/plugins.d
parent36f0ad220ee6fa0ef5968047b4547bb9c31bcca3 (diff)
Implemented the HOST command in metadata log replay (#9489)
Diffstat (limited to 'collectors/plugins.d')
-rw-r--r--collectors/plugins.d/pluginsd_parser.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/collectors/plugins.d/pluginsd_parser.c b/collectors/plugins.d/pluginsd_parser.c
index 213ef57991..c05ddd17d7 100644
--- a/collectors/plugins.d/pluginsd_parser.c
+++ b/collectors/plugins.d/pluginsd_parser.c
@@ -627,6 +627,33 @@ PARSER_RC pluginsd_tombstone(char **words, void *user, PLUGINSD_ACTION *plugins_
return PARSER_RC_OK;
}
+PARSER_RC metalog_pluginsd_host(char **words, void *user, PLUGINSD_ACTION *plugins_action)
+{
+ char *machine_guid = words[1];
+ char *hostname = words[2];
+ char *registry_hostname = words[3];
+ char *update_every_s = words[4];
+ char *os = words[5];
+ char *timezone = words[6];
+ char *tags = words[7];
+
+ int update_every = 1;
+ if (likely(update_every_s && *update_every_s))
+ update_every = str2i(update_every_s);
+ if (unlikely(!update_every))
+ update_every = 1;
+
+ debug(D_PLUGINSD, "HOST PARSED: guid=%s, hostname=%s, reg_host=%s, update=%d, os=%s, timezone=%s, tags=%s",
+ machine_guid, hostname, registry_hostname, update_every, os, timezone, tags);
+
+ if (plugins_action->host_action) {
+ return plugins_action->host_action(
+ user, machine_guid, hostname, registry_hostname, update_every, os, timezone, tags);
+ }
+
+ return PARSER_RC_OK;
+}
+
// New plugins.d parser
inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int trust_durations)