How to monitor Proxmox CPU temp

This was an awesome walk through!! One little amendment to this document to accommodate the newest version, the configuration.yaml should look like this:

command_line:
  - sensor:
      name: "Lenovo M720q CPU Temp"
      command: "ssh -i /config/id_rsa -o StrictHostKeyChecking=no username@proxmox_host_ip -t 'cat /sys/class/thermal/thermal_zone2/temp'"
      unit_of_measurement: "°C"
      scan_interval: 300
      value_template: "{{ (value | multiply(0.001)) | round(1) }}"

Hello so for me it says unknown i have a password for proxmox so where should i ad it maybe that is why it says unkown

Is there a way to check a specific VM/container for it’s stats?

potat0’s post shows how to get CPU, Ram and Disk from Proxmox, but this is the node’s stats rather than an individual VM

Thanks @Goofi , I’ve updated the post.

@callumw I know it’s not quite what you’re looking for but have a look at this grafana dashboard - Proxmox | Grafana Labs . Proxmox allows you to send metrics directly to InfluxDB using the built in metrics server functionality so you could use that and then view the stats in Grafana instead of home assistant.

Thanks for the suggestion.
I already have the SSH set up and am getting the CPU temps, so was hoping that the other data could be pulled out via a command to proxmox similar to the others.

The Grafana does look pretty cool, but it feels like an extra layer of complexity in order to have 2 wee dials show in our HA dashboard :slight_smile:
image

Here is my code

proxmox_command_sensors:

  command_line:
  - sensor:
      name: Proxmox CPU Temp
      command: "ssh -i /config/id_ed25519 -o StrictHostKeyChecking=no root@proxmox_host_ip -t 'sleep 2 && cat /sys/class/thermal/thermal_zone0/temp'"
      # If errors occur, make sure configuration file is encoded as UTF-8
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(0) }}"
      scan_interval: 120
      
  - sensor:
      name: Proxmox SSD sdb Temp
      command: ssh -i /config/id_ed25519 -o StrictHostKeyChecking=no root@proxmox_host_ip -t 'smartctl -a /dev/sdb | grep Temperature' | awk '{printf ("%.1f\n",$10)}'
      unit_of_measurement: "°C"
      value_template: "{{ value | float/1  | round(1) }}"
      scan_interval: 120
      
  - sensor:
      name: Proxmox CPU
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t 'sleep 2 && top -d 0.5 -b -n2 | grep "Cpu(s)" | tail -n 1' | awk '{printf ("%.1f\n",$2 + $4)}'      
      unit_of_measurement: '%'
      scan_interval: 120

  - sensor:
      name: Proxmox RAM
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t free -m | grep Mem | awk '{printf ("%.1f\n",$3*100/$2)}'
      unit_of_measurement: '%'
      scan_interval: 120

  - sensor:
      name: Proxmox Swap
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t free -m | grep Swap | awk '{printf ("%.1f\n",$3*100/$2)}'
      unit_of_measurement: '%'
      scan_interval: 120

  - sensor:
      name: Proxmox SSD Use
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t  df | grep pve-root | awk '{printf ("%.0f\n",$3*100/($3+$4))}'
      unit_of_measurement: '%'
      scan_interval: 120

  - sensor:
      name: Proxmox up Time
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t uptime -p
      scan_interval: 300

  - sensor:
      name: Proxmox Load
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t uptime  | awk '{printf ("%.2f\n",$10)}'
      unit_of_measurement: '%'
      scan_interval: 120
      
  - sensor:
      name: Proxmox io delay
      command: ssh -o StrictHostKeyChecking=no -i /config/id_ed25519 root@proxmox_host_ip -t cat /proc/pressure/io | grep "some" | awk '{printf ("%s",$2)}'
      unit_of_measurement: '%'
      scan_interval: 120
      value_template: >-
        {{ value | replace("avg10=", "") |float }}


Maybe someone will improve or add.

Thanks, that worked perfectly on my Lenovo ThinkCentre M73 !