2
0
mirror of https://github.com/pikvm/pikvm synced 2024-11-01 09:20:17 +00:00
pikvm/docs/prometheus.md
2021-10-12 21:45:00 +03:00

2.9 KiB

Prometheus metrics

Prometheus is one of the popular monitoring systems. It pulls service's endpoint to get metrics in a simple text format. PiKVM has the ability to export some information to this system such as the server's ATX state, Pi's temperature, GPIO state and some other things.

Configure Prometheus

To enable Prometheus getting metrics from pikvm following config could be used:

scrape_configs:
  - job_name: "pikvm"
    metrics_path: "/api/export/prometheus/metrics"
    basic_auth:
      username: admin
      password: admin
    static_configs:
    - targets: ["https://pikvm"]
    tls_config:
      insecure_skip_verify: true # For self-signed certificate

Output example

This example includes the GPIO from the PiKVM's test config.

$ curl -k -HX-KVMD-User:admin -HX-KVMD-Passwd:admin https://pikvm/api/export/prometheus/metrics

# TYPE pikvm_atx_enabled gauge
pikvm_atx_enabled 1

# TYPE pikvm_atx_power gauge
pikvm_atx_power 0

# TYPE pikvm_gpio_input_online_led1 gauge
pikvm_gpio_input_online_led1 0

# TYPE pikvm_gpio_input_state_led1 gauge
pikvm_gpio_input_state_led1 0

# TYPE pikvm_gpio_input_online_led2 gauge
pikvm_gpio_input_online_led2 0

# TYPE pikvm_gpio_input_state_led2 gauge
pikvm_gpio_input_state_led2 0

# TYPE pikvm_gpio_output_online_button1 gauge
pikvm_gpio_output_online_button1 0

# TYPE pikvm_gpio_output_state_button1 gauge
pikvm_gpio_output_state_button1 0

# TYPE pikvm_gpio_output_online_button2 gauge
pikvm_gpio_output_online_button2 0

# TYPE pikvm_gpio_output_state_button2 gauge
pikvm_gpio_output_state_button2 0

# TYPE pikvm_gpio_output_online_relay1 gauge
pikvm_gpio_output_online_relay1 0

# TYPE pikvm_gpio_output_state_relay1 gauge
pikvm_gpio_output_state_relay1 0

# TYPE pikvm_gpio_output_online_relay2 gauge
pikvm_gpio_output_online_relay2 0

# TYPE pikvm_gpio_output_state_relay2 gauge
pikvm_gpio_output_state_relay2 0

# TYPE pikvm_hw_temp_cpu gauge
pikvm_hw_temp_cpu 36.511

# TYPE pikvm_hw_temp_gpu gauge
pikvm_hw_temp_gpu 35.0

# TYPE pikvm_hw_throttling_freq_capped_now gauge
pikvm_hw_throttling_freq_capped_now 0

# TYPE pikvm_hw_throttling_freq_capped_past gauge
pikvm_hw_throttling_freq_capped_past 0

# TYPE pikvm_hw_throttling_throttled_now gauge
pikvm_hw_throttling_throttled_now 0

# TYPE pikvm_hw_throttling_throttled_past gauge
pikvm_hw_throttling_throttled_past 0

# TYPE pikvm_hw_throttling_undervoltage_now gauge
pikvm_hw_throttling_undervoltage_now 0

# TYPE pikvm_hw_throttling_undervoltage_past gauge
pikvm_hw_throttling_undervoltage_past 0

# TYPE pikvm_hw_throttling_raw_flags gauge
pikvm_hw_throttling_raw_flags 0
* Connection #0 to host localhost left intact