Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CPU temperature module kldload to hoster init #42

Closed
yaroslav-gwit opened this issue Jun 11, 2023 · 1 comment
Closed

Add CPU temperature module kldload to hoster init #42

yaroslav-gwit opened this issue Jun 11, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@yaroslav-gwit
Copy link
Owner

Because there are already mechanisms in place to get and filter out the correct CPU information, it will be nice load the CPU temperature kernel module on hoster init if it hasn't been loaded yet, for it's further implementation into the overall system monitoring.

Just a reminder to self:

  • for Intel platforms: kldload coretemp
  • for AMD platforms: kldload amdtemp

To check the temperature:

sysctl dev.cpu | grep -i temperature
@yaroslav-gwit yaroslav-gwit added the enhancement New feature or request label Jun 11, 2023
@yaroslav-gwit yaroslav-gwit self-assigned this Jun 11, 2023
@yaroslav-gwit
Copy link
Owner Author

The change has been implemented like so:

// Add CPU temperature module
cpuInfo := getCpuInfo()
reMatchIntelCpu := regexp.MustCompile(`.*[Ii]ntel.*`)
if reMatchIntelCpu.MatchString(cpuInfo.Model) {
	kernelModuleList = append(kernelModuleList, "coretemp")
} else {
	kernelModuleList = append(kernelModuleList, "amdtemp")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant