coretemp-exporter

module
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2023 License: Apache-2.0

README

coretemp-exporter

CI

A Prometheus exporter that emits CPU health information such as core temperatures. There are also some example dashboards to visualize your computer's sensor data.

Building

To build coretemp-exporter you need Go and Make installed. You can use Linux or Windows hosts to build.

# (optional) Delete all build artifacts.
make clean

# Build all binaries.
make all -j$(nproc)

# Binaries are created in build/$GOOS-$GOARCH/ directory.

Running

You can run coretemp-exporter on Windows or Linux. By default it'll serve its metrics at :8081.

Linux
# Install lm-sensors
sudo apt-get install lm-sensors

# Test that lm-sensors is working.
sensors

# If it's not working try.
sudo sensors-detect

# Run coretemp-exporter.
./build/linux_amd64/coretemp-exporter
Windows
  1. Install and run ALCPU CoreTemp. It is important that this application is running otherwise you will not get any data.
  2. Install MSVC Runtime 10.
  3. Run the commands below.
# Run in the console.
.\build\windows_amd64\coretemp-exporter.exe

###################
# Windows Service #
###################

# Register Service
.\build\windows_amd64\coretemp-exporter.exe -svc=install
# Start Service
.\build\windows_amd64\coretemp-exporter.exe -svc=start
# Stop Service
.\build\windows_amd64\coretemp-exporter.exe -svc=stop
# Uninstall Service
.\build\windows_amd64\coretemp-exporter.exe -svc=remove

Dashboards

You'll need Docker and docker-compose installed. Windows users should run Docker in Linux mode.

# Go to the docker-compose directory.
cd install/compose
# Launch Prometheus and Grafana. 
docker-compose up -d

Once both services are you you can view the graphs via: :3000/dashboards. To login use the following credentials:

  • Username: root
  • Password: admin

Once you've logged in you can visit the CPU page and you should see something like:

Grafana Charts

Directories

Path Synopsis
cmd
common
Package common contains all core structures and API for CoreTemp.
Package common contains all core structures and API for CoreTemp.
coretempsdk
Package coretempsdk is a Go library for interacting with GetCoreTempInfo.dll.
Package coretempsdk is a Go library for interacting with GetCoreTempInfo.dll.
coretempsdk/example
Package main is an example for using the Core Temp SDK.
Package main is an example for using the Core Temp SDK.
lmsensors
Package lmsensors is a Go library reading lm-sensors data.
Package lmsensors is a Go library reading lm-sensors data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL