summaryrefslogtreecommitdiffstats
path: root/web/api
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2019-05-13 15:12:25 +0300
committerChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-05-13 14:12:25 +0200
commit51decad9896131ed478681d90886d63bbd953b14 (patch)
tree25c0360f1d470619c407df805de74b7f4c44b744 /web/api
parentf3473aa8466d73e0a26b437b8494f45030eec89c (diff)
Add system info streaming (#5996)
* Add system info streaming * Fix segmentation fault in unit testing
Diffstat (limited to 'web/api')
-rw-r--r--web/api/web_api_v1.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index 0499dd6718..04c9198cca 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -736,20 +736,20 @@ inline int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, c
web_client_api_request_v1_info_summary_alarm_statuses(host, wb);
buffer_strcat(wb, "\t},\n");
- buffer_sprintf(wb, "\t\"os_name\": %s,\n", getenv("NETDATA_SYSTEM_OS_NAME"));
- buffer_sprintf(wb, "\t\"os_id\": \"%s\",\n", getenv("NETDATA_SYSTEM_OS_ID"));
- buffer_sprintf(wb, "\t\"os_id_like\": \"%s\",\n", getenv("NETDATA_SYSTEM_OS_ID_LIKE"));
- buffer_sprintf(wb, "\t\"os_version\": \"%s\",\n", getenv("NETDATA_SYSTEM_OS_VERSION"));
- buffer_sprintf(wb, "\t\"os_version_id\": \"%s\",\n", getenv("NETDATA_SYSTEM_OS_VERSION_ID"));
- buffer_sprintf(wb, "\t\"os_detection\": \"%s\",\n", getenv("NETDATA_SYSTEM_OS_DETECTION"));
- buffer_sprintf(wb, "\t\"kernel_name\": \"%s\",\n", getenv("NETDATA_SYSTEM_KERNEL_NAME"));
- buffer_sprintf(wb, "\t\"kernel_version\": \"%s\",\n", getenv("NETDATA_SYSTEM_KERNEL_VERSION"));
- buffer_sprintf(wb, "\t\"architecture\": \"%s\",\n", getenv("NETDATA_SYSTEM_ARCHITECTURE"));
- buffer_sprintf(wb, "\t\"virtualization\": \"%s\",\n", getenv("NETDATA_SYSTEM_VIRTUALIZATION"));
- buffer_sprintf(wb, "\t\"virt_detection\": \"%s\",\n", getenv("NETDATA_SYSTEM_VIRT_DETECTION"));
- buffer_sprintf(wb, "\t\"container\": \"%s\",\n", getenv("NETDATA_SYSTEM_CONTAINER"));
- buffer_sprintf(wb, "\t\"container_detection\": \"%s\",\n", getenv("NETDATA_SYSTEM_CONTAINER_DETECTION"));
-
+ buffer_sprintf(wb, "\t\"os_name\": %s,\n", host->system_info->os_name);
+ buffer_sprintf(wb, "\t\"os_id\": \"%s\",\n", host->system_info->os_id);
+ buffer_sprintf(wb, "\t\"os_id_like\": \"%s\",\n", host->system_info->os_id_like);
+ buffer_sprintf(wb, "\t\"os_version\": \"%s\",\n", host->system_info->os_version);
+ buffer_sprintf(wb, "\t\"os_version_id\": \"%s\",\n", host->system_info->os_version_id);
+ buffer_sprintf(wb, "\t\"os_detection\": \"%s\",\n", host->system_info->os_detection);
+ buffer_sprintf(wb, "\t\"kernel_name\": \"%s\",\n", host->system_info->kernel_name);
+ buffer_sprintf(wb, "\t\"kernel_version\": \"%s\",\n", host->system_info->kernel_version);
+ buffer_sprintf(wb, "\t\"architecture\": \"%s\",\n", host->system_info->architecture);
+ buffer_sprintf(wb, "\t\"virtualization\": \"%s\",\n", host->system_info->virtualization);
+ buffer_sprintf(wb, "\t\"virt_detection\": \"%s\",\n", host->system_info->virt_detection);
+ buffer_sprintf(wb, "\t\"container\": \"%s\",\n", host->system_info->container);
+ buffer_sprintf(wb, "\t\"container_detection\": \"%s\",\n", host->system_info->container_detection);
+
buffer_strcat(wb, "\t\"collectors\": [");
chartcollectors2json(host, wb);
buffer_strcat(wb, "\n\t]\n");