diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-17 10:46:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-17 10:46:15 +0000 |
commit | 0d479e33a8ebe206dc5b62135f90880e54b6c117 (patch) | |
tree | 272c5ddc92ae1e568e6df554e94894ee66a2dfd1 /collectors | |
parent | Releasing debian version 1.42.0-1. (diff) | |
download | netdata-0d479e33a8ebe206dc5b62135f90880e54b6c117.tar.xz netdata-0d479e33a8ebe206dc5b62135f90880e54b6c117.zip |
Merging upstream version 1.42.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/apps.plugin/apps_plugin.c | 5 | ||||
-rw-r--r-- | collectors/plugins.d/pluginsd_parser.c | 4 | ||||
-rw-r--r-- | collectors/python.d.plugin/hpssa/hpssa.chart.py | 2 | ||||
-rw-r--r-- | collectors/systemd-journal.plugin/systemd-journal.c | 19 |
4 files changed, 23 insertions, 7 deletions
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c index 94f997e86..d25ae3f9b 100644 --- a/collectors/apps.plugin/apps_plugin.c +++ b/collectors/apps.plugin/apps_plugin.c @@ -16,6 +16,9 @@ fprintf(stdout, PLUGINSD_KEYWORD_FUNCTION " \"processes\" %d \"%s\"\n", PLUGINS_FUNCTIONS_TIMEOUT_DEFAULT, APPS_PLUGIN_PROCESSES_FUNCTION_DESCRIPTION); \ } while(0) +#define APPS_PLUGIN_GLOBAL_FUNCTIONS() do { \ + fprintf(stdout, PLUGINSD_KEYWORD_FUNCTION " GLOBAL \"processes\" %d \"%s\"\n", PLUGINS_FUNCTIONS_TIMEOUT_DEFAULT, APPS_PLUGIN_PROCESSES_FUNCTION_DESCRIPTION); \ + } while(0) // ---------------------------------------------------------------------------- // debugging @@ -5687,7 +5690,7 @@ int main(int argc, char **argv) { netdata_thread_create(&reader_thread, "APPS_READER", NETDATA_THREAD_OPTION_DONT_LOG, reader_main, NULL); netdata_mutex_lock(&mutex); - APPS_PLUGIN_FUNCTIONS(); + APPS_PLUGIN_GLOBAL_FUNCTIONS(); usec_t step = update_every * USEC_PER_SEC; global_iterations_counter = 1; diff --git a/collectors/plugins.d/pluginsd_parser.c b/collectors/plugins.d/pluginsd_parser.c index 19aa4544b..e7a3c40ec 100644 --- a/collectors/plugins.d/pluginsd_parser.c +++ b/collectors/plugins.d/pluginsd_parser.c @@ -887,6 +887,8 @@ static inline PARSER_RC pluginsd_function(char **words, size_t num_words, PARSER rrd_collector_add_function(host, st, name, timeout, help, false, pluginsd_execute_function_callback, parser); + parser->user.data_collections_count++; + return PARSER_RC_OK; } @@ -895,6 +897,8 @@ static void pluginsd_function_result_end(struct parser *parser, void *action_dat if(key) dictionary_del(parser->inflight.functions, string2str(key)); string_freez(key); + + parser->user.data_collections_count++; } static inline PARSER_RC pluginsd_function_result_begin(char **words, size_t num_words, PARSER *parser) { diff --git a/collectors/python.d.plugin/hpssa/hpssa.chart.py b/collectors/python.d.plugin/hpssa/hpssa.chart.py index 4da73dc56..66be00837 100644 --- a/collectors/python.d.plugin/hpssa/hpssa.chart.py +++ b/collectors/python.d.plugin/hpssa/hpssa.chart.py @@ -182,7 +182,7 @@ class HPSSA(object): break elif array_regex.match(line): self.parse_array(adapter) - elif line == 'Unassigned' or line == 'HBA Drives': + elif line in ('Unassigned', 'unassigned') or line == 'HBA Drives': self.parse_physical_drives(adapter) elif ignored_sections_regex.match(line): self.parse_ignored_section() diff --git a/collectors/systemd-journal.plugin/systemd-journal.c b/collectors/systemd-journal.plugin/systemd-journal.c index 08a1891e5..0aaa36044 100644 --- a/collectors/systemd-journal.plugin/systemd-journal.c +++ b/collectors/systemd-journal.plugin/systemd-journal.c @@ -305,14 +305,23 @@ static void systemd_journal_transform_gid(FACETS *facets __maybe_unused, BUFFER } static void systemd_journal_dynamic_row_id(FACETS *facets __maybe_unused, BUFFER *json_array, FACET_ROW_KEY_VALUE *rkv, FACET_ROW *row, void *data __maybe_unused) { - FACET_ROW_KEY_VALUE *syslog_identifier_rkv = dictionary_get(row->dict, "SYSLOG_IDENTIFIER"); FACET_ROW_KEY_VALUE *pid_rkv = dictionary_get(row->dict, "_PID"); + const char *pid = pid_rkv ? buffer_tostring(pid_rkv->wb) : FACET_VALUE_UNSET; + + FACET_ROW_KEY_VALUE *syslog_identifier_rkv = dictionary_get(row->dict, "SYSLOG_IDENTIFIER"); + const char *identifier = syslog_identifier_rkv ? buffer_tostring(syslog_identifier_rkv->wb) : FACET_VALUE_UNSET; - const char *identifier = syslog_identifier_rkv ? buffer_tostring(syslog_identifier_rkv->wb) : "UNKNOWN"; - const char *pid = pid_rkv ? buffer_tostring(pid_rkv->wb) : "UNKNOWN"; + if(strcmp(identifier, FACET_VALUE_UNSET) == 0) { + FACET_ROW_KEY_VALUE *comm_rkv = dictionary_get(row->dict, "_COMM"); + identifier = comm_rkv ? buffer_tostring(comm_rkv->wb) : FACET_VALUE_UNSET; + } buffer_flush(rkv->wb); - buffer_sprintf(rkv->wb, "%s[%s]", identifier, pid); + + if(strcmp(pid, FACET_VALUE_UNSET) == 0) + buffer_strcat(rkv->wb, identifier); + else + buffer_sprintf(rkv->wb, "%s[%s]", identifier, pid); buffer_json_add_array_item_string(json_array, buffer_tostring(rkv->wb)); } @@ -557,7 +566,7 @@ int main(int argc __maybe_unused, char **argv __maybe_unused) { bool tty = isatty(fileno(stderr)) == 1; netdata_mutex_lock(&mutex); - fprintf(stdout, PLUGINSD_KEYWORD_FUNCTION " \"%s\" %d \"%s\"\n", + fprintf(stdout, PLUGINSD_KEYWORD_FUNCTION " GLOBAL \"%s\" %d \"%s\"\n", SYSTEMD_JOURNAL_FUNCTION_NAME, SYSTEMD_JOURNAL_DEFAULT_TIMEOUT, SYSTEMD_JOURNAL_FUNCTION_DESCRIPTION); heartbeat_t hb; |