add DYNCFG_RESET (#16241)
Timotej S committed
Oct 20, 2023 at 14:07 UTC
6c05c827d96495edc4925c86650283f87d21c448
6 files changed
+134
-90
collectors/plugins.d/gperf-config.txt
+13
-12
@@ -37,21 +37,22 @@ VARIABLE, 53, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_
37
DYNCFG_ENABLE, 101, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 20
38
DYNCFG_REGISTER_MODULE, 102, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 21
39
DYNCFG_REGISTER_JOB, 103, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 22
40
-REPORT_JOB_STATUS, 110, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 23
41
-DELETE_JOB, 111, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 24
40
+DYNCFG_RESET, 104, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 23
41
+REPORT_JOB_STATUS, 110, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 24
42
+DELETE_JOB, 111, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 25
43
#
44
# Streaming only keywords
45
#
45
-CLAIMED_ID, 61, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 25
46
-BEGIN2, 2, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 26
47
-SET2, 1, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 27
48
-END2, 3, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 28
46
+CLAIMED_ID, 61, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 26
47
+BEGIN2, 2, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 27
48
+SET2, 1, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 28
49
+END2, 3, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 29
50
#
51
# Streaming Replication keywords
52
#
52
-CHART_DEFINITION_END, 33, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 29
53
-RBEGIN, 22, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 30
54
-RDSTATE, 23, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 31
55
-REND, 25, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 32
56
-RSET, 21, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 33
57
-RSSTATE, 24, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 34
53
+CHART_DEFINITION_END, 33, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 30
54
+RBEGIN, 22, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 31
55
+RDSTATE, 23, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 32
56
+REND, 25, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 33
57
+RSET, 21, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 34
58
+RSSTATE, 24, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 35
collectors/plugins.d/gperf-hashtable.h
+83
-77
@@ -30,12 +30,12 @@
30
#endif
31
32
33
-#define GPERF_PARSER_TOTAL_KEYWORDS 34
33
+#define GPERF_PARSER_TOTAL_KEYWORDS 35
34
#define GPERF_PARSER_MIN_WORD_LENGTH 3
35
#define GPERF_PARSER_MAX_WORD_LENGTH 22
36
#define GPERF_PARSER_MIN_HASH_VALUE 3
37
-#define GPERF_PARSER_MAX_HASH_VALUE 36
38
-/* maximum key range = 34, duplicates = 0 */
37
+#define GPERF_PARSER_MAX_HASH_VALUE 47
38
+/* maximum key range = 45, duplicates = 0 */
39
40
#ifdef __GNUC__
41
__inline
@@ -49,32 +49,32 @@ gperf_keyword_hash_function (register const char *str, register size_t len)
49
{
50
static unsigned char asso_values[] =
51
{
52
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
53
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
54
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
55
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
56
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
57
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
58
- 37, 37, 37, 37, 37, 12, 28, 5, 2, 0,
59
- 0, 37, 3, 13, 37, 37, 14, 37, 0, 2,
60
- 37, 37, 1, 3, 37, 6, 10, 37, 32, 2,
61
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
62
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
63
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
64
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
65
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
66
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
67
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
68
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
69
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
70
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
71
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
72
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
73
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
74
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
75
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
76
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
77
- 37, 37, 37, 37, 37, 37
52
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
53
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
54
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
55
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
56
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
57
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
58
+ 48, 48, 48, 48, 48, 11, 18, 0, 0, 0,
59
+ 6, 48, 9, 0, 48, 48, 20, 48, 0, 8,
60
+ 48, 48, 1, 12, 48, 20, 18, 48, 2, 0,
61
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
62
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
63
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
64
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
65
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
66
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
67
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
68
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
69
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
70
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
71
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
72
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
73
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
74
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
75
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
76
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
77
+ 48, 48, 48, 48, 48, 48
78
};
79
return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
80
}
@@ -84,72 +84,78 @@ static PARSER_KEYWORD gperf_keywords[] =
84
{(char*)0}, {(char*)0}, {(char*)0},
85
#line 30 "gperf-config.txt"
86
{"END", 13, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 13},
87
-#line 48 "gperf-config.txt"
88
- {"END2", 3, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 28},
87
+#line 49 "gperf-config.txt"
88
+ {"END2", 3, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 29},
89
+#line 56 "gperf-config.txt"
90
+ {"REND", 25, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 33},
91
+#line 17 "gperf-config.txt"
92
+ {"EXIT", 99, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 3},
93
+#line 16 "gperf-config.txt"
94
+ {"DISABLE", 98, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 2},
95
#line 55 "gperf-config.txt"
90
- {"REND", 25, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 32},
96
+ {"RDSTATE", 23, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 32},
97
+#line 29 "gperf-config.txt"
98
+ {"DIMENSION", 31, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 12},
99
+#line 42 "gperf-config.txt"
100
+ {"DELETE_JOB", 111, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 25},
101
+ {(char*)0},
102
+#line 40 "gperf-config.txt"
103
+ {"DYNCFG_RESET", 104, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 23},
104
+#line 37 "gperf-config.txt"
105
+ {"DYNCFG_ENABLE", 101, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 20},
106
+#line 26 "gperf-config.txt"
107
+ {"CHART", 32, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 9},
108
#line 35 "gperf-config.txt"
109
{"SET", 11, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 18},
93
-#line 47 "gperf-config.txt"
94
- {"SET2", 1, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 27},
95
-#line 56 "gperf-config.txt"
96
- {"RSET", 21, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 33},
110
+#line 48 "gperf-config.txt"
111
+ {"SET2", 1, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 28},
112
+#line 57 "gperf-config.txt"
113
+ {"RSET", 21, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 34},
114
+#line 41 "gperf-config.txt"
115
+ {"REPORT_JOB_STATUS", 110, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 24},
116
+#line 39 "gperf-config.txt"
117
+ {"DYNCFG_REGISTER_JOB", 103, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 22},
118
+#line 58 "gperf-config.txt"
119
+ {"RSSTATE", 24, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 35},
120
#line 18 "gperf-config.txt"
121
{"HOST", 71, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 4},
122
+#line 38 "gperf-config.txt"
123
+ {"DYNCFG_REGISTER_MODULE", 102, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 21},
124
+#line 25 "gperf-config.txt"
125
+ {"BEGIN", 12, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 8},
126
+#line 47 "gperf-config.txt"
127
+ {"BEGIN2", 2, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 27},
128
#line 54 "gperf-config.txt"
100
- {"RDSTATE", 23, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 31},
101
-#line 57 "gperf-config.txt"
102
- {"RSSTATE", 24, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 34},
103
-#line 41 "gperf-config.txt"
104
- {"DELETE_JOB", 111, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 24},
105
-#line 26 "gperf-config.txt"
106
- {"CHART", 32, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 9},
107
-#line 31 "gperf-config.txt"
108
- {"FUNCTION", 41, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 14},
129
+ {"RBEGIN", 22, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 31},
130
+#line 27 "gperf-config.txt"
131
+ {"CLABEL", 34, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 10},
132
#line 21 "gperf-config.txt"
133
{"HOST_LABEL", 74, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 7},
134
#line 19 "gperf-config.txt"
135
{"HOST_DEFINE", 72, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 5},
113
-#line 37 "gperf-config.txt"
114
- {"DYNCFG_ENABLE", 101, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 20},
115
-#line 40 "gperf-config.txt"
116
- {"REPORT_JOB_STATUS", 110, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 23},
136
+#line 53 "gperf-config.txt"
137
+ {"CHART_DEFINITION_END", 33, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 30},
138
+#line 46 "gperf-config.txt"
139
+ {"CLAIMED_ID", 61, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 26},
140
#line 15 "gperf-config.txt"
141
{"FLUSH", 97, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 1},
142
#line 20 "gperf-config.txt"
143
{"HOST_DEFINE_END", 73, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 6},
144
+#line 28 "gperf-config.txt"
145
+ {"CLABEL_COMMIT", 35, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 11},
146
+#line 31 "gperf-config.txt"
147
+ {"FUNCTION", 41, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 14},
148
#line 34 "gperf-config.txt"
149
{"OVERWRITE", 52, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 17},
123
-#line 16 "gperf-config.txt"
124
- {"DISABLE", 98, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 2},
125
-#line 39 "gperf-config.txt"
126
- {"DYNCFG_REGISTER_JOB", 103, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 22},
127
-#line 29 "gperf-config.txt"
128
- {"DIMENSION", 31, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 12},
129
-#line 27 "gperf-config.txt"
130
- {"CLABEL", 34, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 10},
131
-#line 38 "gperf-config.txt"
132
- {"DYNCFG_REGISTER_MODULE", 102, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 21},
133
-#line 32 "gperf-config.txt"
134
- {"FUNCTION_RESULT_BEGIN", 42, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 15},
135
-#line 52 "gperf-config.txt"
136
- {"CHART_DEFINITION_END", 33, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 29},
137
-#line 45 "gperf-config.txt"
138
- {"CLAIMED_ID", 61, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 25},
139
-#line 36 "gperf-config.txt"
140
- {"VARIABLE", 53, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 19},
150
#line 33 "gperf-config.txt"
151
{"LABEL", 51, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 16},
143
-#line 28 "gperf-config.txt"
144
- {"CLABEL_COMMIT", 35, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 11},
145
-#line 25 "gperf-config.txt"
146
- {"BEGIN", 12, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 8},
147
-#line 46 "gperf-config.txt"
148
- {"BEGIN2", 2, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 26},
149
-#line 53 "gperf-config.txt"
150
- {"RBEGIN", 22, PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 30},
151
-#line 17 "gperf-config.txt"
152
- {"EXIT", 99, PARSER_INIT_PLUGINSD, WORKER_PARSER_FIRST_JOB + 3}
152
+#line 36 "gperf-config.txt"
153
+ {"VARIABLE", 53, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 19},
154
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
155
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
156
+ {(char*)0},
157
+#line 32 "gperf-config.txt"
158
+ {"FUNCTION_RESULT_BEGIN", 42, PARSER_INIT_PLUGINSD|PARSER_INIT_STREAMING, WORKER_PARSER_FIRST_JOB + 15}
159
};
160
161
PARSER_KEYWORD *
collectors/plugins.d/plugins_d.h
+1
@@ -16,6 +16,7 @@
16
#define PLUGINSD_KEYWORD_DYNCFG_ENABLE "DYNCFG_ENABLE"
17
#define PLUGINSD_KEYWORD_DYNCFG_REGISTER_MODULE "DYNCFG_REGISTER_MODULE"
18
#define PLUGINSD_KEYWORD_DYNCFG_REGISTER_JOB "DYNCFG_REGISTER_JOB"
19
+#define PLUGINSD_KEYWORD_DYNCFG_RESET "DYNCFG_RESET"
20
21
#define PLUGINSD_KEYWORD_REPORT_JOB_STATUS "REPORT_JOB_STATUS"
22
#define PLUGINSD_KEYWORD_DELETE_JOB "DELETE_JOB"
collectors/plugins.d/pluginsd_parser.c
+22
@@ -2485,6 +2485,25 @@ static inline PARSER_RC pluginsd_register_job(char **words __maybe_unused, size_
2485
return pluginsd_register_job_common(&words[2], num_words - 2, parser, words[1]);
2486
}
2487
2488
+static inline PARSER_RC pluginsd_dyncfg_reset(char **words __maybe_unused, size_t num_words __maybe_unused, PARSER *parser __maybe_unused) {
2489
+ if (unlikely(num_words != (SERVING_PLUGINSD(parser) ? 1 : 2)))
2490
+ return PLUGINSD_DISABLE_PLUGIN(parser, PLUGINSD_KEYWORD_DYNCFG_RESET, SERVING_PLUGINSD(parser) ? "expected 0 parameters" : "expected 1 parameter: plugin_name");
2491
+
2492
+ if (SERVING_PLUGINSD(parser)) {
2493
+ unregister_plugin(parser->user.host->configurable_plugins, parser->user.cd->cfg_dict_item);
2494
+ rrdpush_send_dyncfg_reset(parser->user.host, parser->user.cd->configuration->name);
2495
+ parser->user.cd->configuration = NULL;
2496
+ } else {
2497
+ const DICTIONARY_ITEM *di = dictionary_get_and_acquire_item(parser->user.host->configurable_plugins, words[1]);
2498
+ if (unlikely(di == NULL))
2499
+ return PLUGINSD_DISABLE_PLUGIN(parser, PLUGINSD_KEYWORD_DYNCFG_RESET, "plugin not found");
2500
+ unregister_plugin(parser->user.host->configurable_plugins, di);
2501
+ rrdpush_send_dyncfg_reset(parser->user.host, words[1]);
2502
+ }
2503
+
2504
+ return PARSER_RC_OK;
2505
+}
2506
+
2507
static inline PARSER_RC pluginsd_job_status_common(char **words, size_t num_words, PARSER *parser, const char *plugin_name) {
2508
int state = str2i(words[3]);
2509
@@ -2866,6 +2885,9 @@ PARSER_RC parser_execute(PARSER *parser, PARSER_KEYWORD *keyword, char **words,
2885
case 103:
2886
return pluginsd_register_job(words, num_words, parser);
2887
2888
+ case 104:
2889
+ return pluginsd_dyncfg_reset(words, num_words, parser);
2890
+
2891
case 110:
2892
return pluginsd_job_status(words, num_words, parser);
2893
streaming/rrdpush.c
+13
@@ -674,6 +674,19 @@ void rrdpush_send_dyncfg_reg_job(RRDHOST *host, const char *plugin_name, const c
674
sender_thread_buffer_free();
675
}
676
677
+void rrdpush_send_dyncfg_reset(RRDHOST *host, const char *plugin_name)
678
+{
679
+ dyncfg_check_can_push(host);
680
+
681
+ BUFFER *wb = sender_start(host->sender);
682
+
683
+ buffer_sprintf(wb, PLUGINSD_KEYWORD_DYNCFG_RESET " %s\n", plugin_name);
684
+
685
+ sender_commit(host->sender, wb, STREAM_TRAFFIC_TYPE_METADATA);
686
+
687
+ sender_thread_buffer_free();
688
+}
689
+
690
void rrdpush_send_claimed_id(RRDHOST *host) {
691
if(!stream_has_capability(host->sender, STREAM_CAP_CLAIM))
692
return;
streaming/rrdpush.h
+2
-1
@@ -781,6 +781,7 @@ void rrdpush_send_job_deleted(RRDHOST *host, const char *plugin_name, const char
781
782
void rrdpush_send_dyncfg_enable(RRDHOST *host, const char *plugin_name);
783
void rrdpush_send_dyncfg_reg_module(RRDHOST *host, const char *plugin_name, const char *module_name, enum module_type type);
784
-void rrdpush_send_dyncfg_reg_job(RRDHOST *host, const char *plugin_name, const char *module_name, const char *job_name, enum job_type type, uint32_t flags);//x
784
+void rrdpush_send_dyncfg_reg_job(RRDHOST *host, const char *plugin_name, const char *module_name, const char *job_name, enum job_type type, uint32_t flags);
785
+void rrdpush_send_dyncfg_reset(RRDHOST *host, const char *plugin_name);
786
787
#endif //NETDATA_RRDPUSH_H