blob: 7c5d4fd5aefea5d2dae0f7306c466b853de78d65 [file] [log] [blame]
Lorenz Brun595dfe92023-02-21 19:13:02 +01001syntax = "proto3";
2package cloud.agent.api;
3option go_package = "source.monogon.dev/cloud/agent/api";
4
5message BlockDevice {
6 // Name of the vendor of the block device
7 string vendor = 1;
8 // Device model of the block device
9 string device_model = 2;
10 // Serial number of the block device
11 string serial_number = 3;
12 // World Wide Name of the block device (not always available)
13 bytes wwn = 4;
14 // Set if this is a rotational disk
15 bool rotational = 5;
16
17 // Usable capacity in bytes
18 int64 capacity_bytes = 6;
19
20 // Logical and physical block size in bytes. Note that on many modern
21 // enterprise drives these can be changed.
22 int32 logical_block_size_bytes = 7;
23 int32 physical_block_size_bytes = 8;
24
25 enum Protocol {
26 UNKNOWN = 0;
27 SCSI = 1;
28 ATA = 2;
29 NVME = 3;
30 MMC = 4;
31 }
32 Protocol protocol = 9;
33
34 // Set if the block device has reasons to believe that it will fail soon.
35 // This is entirely controlled by firmware, its accuracy is as good as
36 // the vendor has made it.
37 bool critical_warning = 10;
38
39 // Number of unrecoverable media read errors.
40 // On SATA disks this is technically equivalent to Raw_Read_Error_Rate, but
41 // only a tiny minority of devices populate that sanely. So instead this is
42 // defined as the sum of S.M.A.R.T. attributes 5, 197 and 198.
43 optional int64 media_errors = 11;
44
45 // Fraction of spare space still available to replace bad blocks.
46 // If this reaches zero, the disk generally dies.
47 optional float available_spare_ratio = 12;
48
49 // Fraction of the estimated life of the device used up.
50 // Only considers flash wear, not runtime or similar.
51 // Reported by firmware, as accurate as the vendor has made it.
52 optional float usage_ratio = 13;
53}
54
55message NetworkInterface {
56 // Contains the EUI-48 MAC address of the interface.
57 bytes mac = 1;
58 // Linux kernel driver which is bound to the interface.
59 string driver = 2;
60
61 // List of supported speeds in bytes per second.
62 repeated int64 supported_speed_bytes = 3;
63
64 // Does the interface have an active link.
65 bool link_up = 4;
66 // Currently-negotiated speed in bytes per second. Unstable on marginal
67 // links.
68 int64 current_speed_bytes = 5;
69}
70
71message CPU {
72 message X86_64 {
73 // Family of the CPU, including extended family.
74 // For example 6 for Intel's "big" cores.
75 int32 family = 1;
76 // Model of the CPU, including extended model.
77 // For example 154 for ADL-S.
78 int32 model = 2;
79 // Stepping of the CPU, model-dependent value.
80 int32 stepping = 3;
81 }
82 oneof architecture {
83 X86_64 x86_64 = 1;
84 // Information specific to other architectures can be added here.
85 }
86 // Number of hardware threads (including SMT threads, harts, ...) exposed to
87 // to the operating system.
88 int32 hardware_threads = 9;
89 // Number of cores of the CPU. This does not include SMT threads or other
90 // equivalent mechanisms to increase logical core count.
91 int32 cores = 8;
92 // Name of the vendor of the CPU
93 string vendor = 10;
94 // Name of the model of the CPU
95 string model = 11;
96}
97
Lorenz Brun1cd26962023-04-19 16:10:17 +020098enum EFISupport {
99 // EFI support was not evaluated by the report generator.
100 EFI_INVALID = 0;
101 // It is not known if EFI is supported by the node. EFI runtime services are
102 // not available. This occurs if the report generator generally supports
103 // reporting EFI support, but none of its mechanisms to determine EFI support
104 // returned any data.
105 EFI_UNKNOWN = 1;
106 // The firmware indicates that EFI is not supported by the node. EFI runtime
107 // services are not available.
108 // Note that the firmware indication can be wrong.
109 EFI_UNSUPPORTED = 2;
110 // The firmware indicates that EFI is supported, but EFI runtime services
111 // are not available. This usually means that the hardware report was
112 // generated from a kernel booted in Compatibility Support Mode (CSM).
113 // Note that the firmware indication can be wrong.
114 EFI_SUPPORTED = 3;
115 // EFI and its runtime services are available and working.
116 EFI_ENABLED = 4;
117}
118
Lorenz Brun595dfe92023-02-21 19:13:02 +0100119message Node {
120 // Manufacturer of the system, taken from DMI.
121 string manufacturer = 1;
122 // Product name, taken from DMI.
123 string product = 2;
124 // Serial number of the system, taken from DMI.
125 string serial_number = 3;
126
Lorenz Brun1cd26962023-04-19 16:10:17 +0200127 // Information about EFI support in the node firmware.
128 EFISupport efi_support = 13;
129
Lorenz Brun595dfe92023-02-21 19:13:02 +0100130 // Amount of physical memory installed, in bytes. Determined using DMI (if
131 // available and not marked unusable) or memory blocks in sysfs
132 // (/sys/devices/system/memory/...). This is not taken from meminfo as that
133 // value is relatively unstable and hard to match to.
134 // Assuming a non-terrible firmware implementation this value is expected to
135 // be stable.
136 int64 memory_installed_bytes = 8;
137
138 // Ratio of claimed installed memory which is available to the Linux
139 // kernel (taken from sysinfo's totalmem). Note that this value is unstable
140 // across kernel versions and even firmware configuration settings and should
141 // only be used to detect gross mismatches. 1 means all of the claimed
142 // installed memory is available, 0 means none.
143 float memory_usable_ratio = 9;
144
145 repeated CPU cpu = 10;
146 repeated BlockDevice block_device = 11;
147 repeated NetworkInterface network_interface = 12;
148}