summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:12 +0000
commit51dfb248933e5fac12fee1be8471bb08f9554428 (patch)
tree1d25518313ca94af4257e56ef919605a219a4178 /collectors
parentAdding upstream version 1.42.0. (diff)
downloadnetdata-upstream/1.42.1.tar.xz
netdata-upstream/1.42.1.zip
Adding upstream version 1.42.1.upstream/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.c5
-rw-r--r--collectors/plugins.d/pluginsd_parser.c4
-rw-r--r--collectors/python.d.plugin/hpssa/hpssa.chart.py2
-rw-r--r--collectors/systemd-journal.plugin/systemd-journal.c19
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;