MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / GetSystemInfo

Method GetSystemInfo

agent-source-code/internal/system/system.go:235–255  ·  view source on GitHub ↗

GetSystemInfo gets additional system information

()

Source from the content-addressed store, hash-verified

233
234// GetSystemInfo gets additional system information
235func (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
258func (d *Detector) GetArchitecture() string {

Callers 1

sendReportFunction · 0.80

Calls 4

GetKernelVersionMethod · 0.95
getSELinuxStatusMethod · 0.95
getSystemUptimeMethod · 0.95
getLoadAverageMethod · 0.95

Tested by

no test coverage detected