From bfd70600443086c8d87997955c08e99a9f9cc02f Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Sun, 6 Mar 2022 10:51:24 +0200 Subject: [PATCH] read linux kernel variables from host sensor --- hostsensorutils/hostsensorgetfrompod.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hostsensorutils/hostsensorgetfrompod.go b/hostsensorutils/hostsensorgetfrompod.go index 47e63fa8..5287595c 100644 --- a/hostsensorutils/hostsensorgetfrompod.go +++ b/hostsensorutils/hostsensorgetfrompod.go @@ -91,6 +91,12 @@ func (hsh *HostSensorHandler) sendAllPodsHTTPGETRequest(path, requestKind string return res, nil } +// return list of LinuxKernelVariables +func (hsh *HostSensorHandler) GetKernelVariables() ([]hostsensor.HostSensorDataEnvelope, error) { + // loop over pods and port-forward it to each of them + return hsh.sendAllPodsHTTPGETRequest("/LinuxKernelVariables", "LinuxKernelVariables") +} + // return list of OpenPortsList func (hsh *HostSensorHandler) GetOpenPortsList() ([]hostsensor.HostSensorDataEnvelope, error) { // loop over pods and port-forward it to each of them @@ -195,6 +201,12 @@ func (hsh *HostSensorHandler) CollectResources() ([]hostsensor.HostSensorDataEnv return kcData, err } res = append(res, kcData...) + // GetKernelVariables + kcData, err = hsh.GetKernelVariables() + if err != nil { + return kcData, err + } + res = append(res, kcData...) // finish logger.L().Debug("Done reading information from host sensor")