Prometheus exporter to collect the inlet temperature of the server using the ipmitool
command.
- A
Go
development environment to compile the program. ipmitool
in the host we want to monitor.
[root@localhost ~] git clone [email protected]:cfm-mpc/ipmitool_exporter.git
[root@localhost ~] cd ipmitool_exporter
Compile the exporter:
[root@localhost ipmitool_exporter] make
Run the binary in the host you want to monitor. You can cofigure a system service for this.
[root@localhost ipmitool_exporter] ./ipmitool_exporter -sensor "Inlet Temp" -address=":5000" -path="/metrics"
Check that the metrics are being exposed succesfully:
[root@localhost ipmitool_exporter] curl -L localhost:5000/metrics
# HELP go_threads Number of OS threads created.
# TYPE go_threads gauge
go_threads 7
# HELP ipmitool_temp Inlet Temperature
# TYPE ipmitool_temp gauge
ipmitool_temp 32
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 262144
- A
Prometheus server
(accessible through http by theipmitool_exporter
) - A
Grafana server
(accessible through http by Prometheus)
- Configure Prometheus to scrape the metrics from the host we want to monitor:
[root@prometheus ~] sudo vim /etc/prometheus/prometheus.yml
(...)
- job_name: "inlet-temperature"
metrics_path: "/metrics"
static_configs:
- targets: ["localhost:5000"]
- Import the dashboard (
grafana/inlet-temperature.json
) into Grafana:Dashboards
->New
->Import
->Upload JSON file