summaryrefslogtreecommitdiffstats
path: root/web/api/web_api_v1.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/api/web_api_v1.c')
-rw-r--r--web/api/web_api_v1.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index 991a9ec8b3..528794c307 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -717,6 +717,7 @@ static inline void web_client_api_request_v1_info_mirrored_hosts(BUFFER *wb) {
inline int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, char *url) {
(void)url;
+ if (!netdata_ready) return 400;
BUFFER *wb = w->response.data;
buffer_flush(wb);
@@ -732,7 +733,25 @@ inline int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, c
buffer_strcat(wb, "\t\"alarms\": {\n");
web_client_api_request_v1_info_summary_alarm_statuses(host, wb);
- buffer_strcat(wb, "\t}\n");
+ 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_strcat(wb, "\t\"collectors\": [");
+ chartcollectors2json(host, wb);
+ buffer_strcat(wb, "\n\t]\n");
buffer_strcat(wb, "}");
return 200;