GetSystemInfo gets additional system information
()
| 233 | |
| 234 | // GetSystemInfo gets additional system information |
| 235 | func (d *Detector) GetSystemInfo() models.SystemInfo { |
| 236 | d.logger.Debug("Beginning system information collection") |
| 237 | |
| 238 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 239 | defer cancel() |
| 240 | |
| 241 | info := models.SystemInfo{ |
| 242 | KernelVersion: d.GetKernelVersion(), |
| 243 | SELinuxStatus: d.getSELinuxStatus(), |
| 244 | SystemUptime: d.getSystemUptime(ctx), |
| 245 | LoadAverage: d.getLoadAverage(ctx), |
| 246 | } |
| 247 | |
| 248 | d.logger.WithFields(logrus.Fields{ |
| 249 | "kernel": info.KernelVersion, |
| 250 | "selinux": info.SELinuxStatus, |
| 251 | "uptime": info.SystemUptime, |
| 252 | }).Debug("Collected kernel, SELinux, and uptime information") |
| 253 | |
| 254 | return info |
| 255 | } |
| 256 | |
| 257 | // GetArchitecture returns the system architecture |
| 258 | func (d *Detector) GetArchitecture() string { |
no test coverage detected