573
freez(system_info->host_os_version);
574
freez(system_info->host_os_version_id);
575
freez(system_info->host_os_detection);
576
+ freez(system_info->host_cores);
577
+ freez(system_info->host_cpu_freq);
578
+ freez(system_info->host_ram_total);
579
+ freez(system_info->host_disk_space);
580
freez(system_info->container_os_name);
581
freez(system_info->container_os_id);
582
freez(system_info->container_os_id_like);
790
label_list =
791
add_label_to_list(label_list, "_kernel_version", localhost->system_info->kernel_version, LABEL_SOURCE_AUTO);
792
793
+ if (localhost->system_info->host_cores)
794
+ label_list =
795
+ add_label_to_list(label_list, "_system_cores", localhost->system_info->host_cores, LABEL_SOURCE_AUTO);
796
+
797
+ if (localhost->system_info->host_cpu_freq)
798
+ label_list =
799
+ add_label_to_list(label_list, "_system_cpu_freq", localhost->system_info->host_cpu_freq, LABEL_SOURCE_AUTO);
800
+
801
+ if (localhost->system_info->host_ram_total)
802
+ label_list =
803
+ add_label_to_list(label_list, "_system_ram_total", localhost->system_info->host_ram_total, LABEL_SOURCE_AUTO);
804
+
805
+ if (localhost->system_info->host_disk_space)
806
+ label_list =
807
+ add_label_to_list(label_list, "_system_disk_space", localhost->system_info->host_disk_space, LABEL_SOURCE_AUTO);
808
+
809
if (localhost->system_info->architecture)
810
label_list =
811
add_label_to_list(label_list, "_architecture", localhost->system_info->architecture, LABEL_SOURCE_AUTO);
1328
1329
// ----------------------------------------------------------------------------
1330
// RRDHOST - set system info from environment variables
1311
-
1331
+// system_info fields must be heap allocated or NULL
1332
int rrdhost_set_system_info_variable(struct rrdhost_system_info *system_info, char *name, char *value) {
1333
int res = 0;
1334
1386
freez(system_info->kernel_name);
1387
system_info->kernel_name = strdupz(value);
1388
}
1389
+ else if(!strcmp(name, "NETDATA_SYSTEM_CPU_LOGICAL_CPU_COUNT")){
1390
+ freez(system_info->host_cores);
1391
+ system_info->host_cores = strdupz(value);
1392
+ }
1393
+ else if(!strcmp(name, "NETDATA_SYSTEM_CPU_FREQ")){
1394
+ freez(system_info->host_cpu_freq);
1395
+ system_info->host_cpu_freq = strdupz(value);
1396
+ }
1397
+ else if(!strcmp(name, "NETDATA_SYSTEM_TOTAL_RAM")){
1398
+ freez(system_info->host_ram_total);
1399
+ system_info->host_ram_total = strdupz(value);
1400
+ }
1401
+ else if(!strcmp(name, "NETDATA_SYSTEM_TOTAL_DISK_SIZE")){
1402
+ freez(system_info->host_disk_space);
1403
+ system_info->host_disk_space = strdupz(value);
1404
+ }
1405
else if(!strcmp(name, "NETDATA_SYSTEM_KERNEL_VERSION")){
1406
freez(system_info->kernel_version);
1407
system_info->kernel_version = strdupz(value);
1426
freez(system_info->container_detection);
1427
system_info->container_detection = strdupz(value);
1428
}
1429
+ else if (!strcmp(name, "NETDATA_SYSTEM_CPU_VENDOR"))
1430
+ return res;
1431
+ else if (!strcmp(name, "NETDATA_SYSTEM_CPU_MODEL"))
1432
+ return res;
1433
+ else if (!strcmp(name, "NETDATA_SYSTEM_CPU_DETECTION"))
1434
+ return res;
1435
+ else if (!strcmp(name, "NETDATA_SYSTEM_RAM_DETECTION"))
1436
+ return res;
1437
+ else if (!strcmp(name, "NETDATA_SYSTEM_DISK_DETECTION"))
1438
+ return res;
1439
else {
1440
res = 1;
1441
}