From 841395dd16f470e3c051a0a4fff5b91efc983c30 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 May 2021 14:33:27 +0200 Subject: Adding upstream version 1.31.0. Signed-off-by: Daniel Baumann --- web/api/web_api_v1.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 2 deletions(-) (limited to 'web/api/web_api_v1.c') diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c index 1d8217bbd..96fcf485a 100644 --- a/web/api/web_api_v1.c +++ b/web/api/web_api_v1.c @@ -750,6 +750,7 @@ inline int web_client_api_request_v1_registry(RRDHOST *host, struct web_client * if(unlikely(action == 'H')) { // HELLO request, dashboard ACL + analytics_log_dashboard(); if(unlikely(!web_client_can_access_dashboard(w))) return web_client_permission_denied(w); } @@ -995,10 +996,82 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb) } #ifdef ENABLE_ACLK if (aclk_connected) - buffer_strcat(wb, "\t\"aclk-available\": true\n"); + buffer_strcat(wb, "\t\"aclk-available\": true,\n"); else #endif - buffer_strcat(wb, "\t\"aclk-available\": false\n"); // Intentionally valid with/without #ifdef above + buffer_strcat(wb, "\t\"aclk-available\": false,\n"); // Intentionally valid with/without #ifdef above + + buffer_strcat(wb, "\t\"memory-mode\": "); + analytics_get_data(analytics_data.netdata_config_memory_mode, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"multidb-disk-quota\": "); + analytics_get_data(analytics_data.netdata_config_multidb_disk_quota, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"page-cache-size\": "); + analytics_get_data(analytics_data.netdata_config_page_cache_size, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"stream-enabled\": "); + analytics_get_data(analytics_data.netdata_config_stream_enabled, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"hosts-available\": "); + analytics_get_data(analytics_data.netdata_config_hosts_available, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"https-enabled\": "); + analytics_get_data(analytics_data.netdata_config_https_enabled, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"buildinfo\": "); + analytics_get_data(analytics_data.netdata_buildinfo, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"release-channel\": "); + analytics_get_data(analytics_data.netdata_config_release_channel, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"web-enabled\": "); + analytics_get_data(analytics_data.netdata_config_web_enabled, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"notification-methods\": "); + analytics_get_data(analytics_data.netdata_notification_methods, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"exporting-enabled\": "); + analytics_get_data(analytics_data.netdata_config_exporting_enabled, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"exporting-connectors\": "); + analytics_get_data(analytics_data.netdata_exporting_connectors, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"allmetrics-prometheus-used\": "); + analytics_get_data(analytics_data.netdata_allmetrics_prometheus_used, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"allmetrics-shell-used\": "); + analytics_get_data(analytics_data.netdata_allmetrics_shell_used, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"allmetrics-json-used\": "); + analytics_get_data(analytics_data.netdata_allmetrics_json_used, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"dashboard-used\": "); + analytics_get_data(analytics_data.netdata_dashboard_used, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"charts-count\": "); + analytics_get_data(analytics_data.netdata_charts_count, wb); + buffer_strcat(wb, ",\n"); + + buffer_strcat(wb, "\t\"metrics-count\": "); + analytics_get_data(analytics_data.netdata_metrics_count, wb); + buffer_strcat(wb, "\n"); buffer_strcat(wb, "}"); return 0; -- cgit v1.2.3