Read sensors through IPMI

Hi everyone. I am new to this forum and try to learn how to use HA that btw is fantastic!

Among other things I was trying to integrate some sensors info of my Supermicro server in HA but I did see anything concerning this topic.
I am running HA in VM generate with python3 venv on a Linux Mint VM mounted on ESXi on a Supermicro hardware.

I just discovered that with this command I am able to read all sensors of my motherboard:

ipmitool -I lanplus -H -U -P sdr elist full

Where
IPADDR is the IP of my Supermicro IPMI lan
User the user of the Supermicro server
Pswrd the password of the Supermicro server

And I get something like this:

CPU Temp | 01h | ok | 3.1 | 70 degrees C
PCH Temp | 0Ah | ok | 7.3 | 57 degrees C
System Temp | 0Bh | ok | 7.1 | 51 degrees C
Peripheral Temp | 0Ch | ok | 7.2 | 57 degrees C
VcpuVRM Temp | 10h | ok | 8.1 | 78 degrees C
DIMMA1 Temp | B0h | ok | 32.64 | 49 degrees C
DIMMB1 Temp | B4h | ok | 32.68 | 51 degrees C
FAN1 | 41h | ok | 29.1 | 5200 RPM
FAN2 | 42h | ok | 29.2 | 7400 RPM
FAN3 | 43h | ok | 29.3 | 5300 RPM
12V | 30h | ok | 7.17 | 11.81 Volts
5VCC | 31h | ok | 7.33 | 4.95 Volts
3.3VCC | 32h | ok | 7.32 | 3.28 Volts
VBAT | 33h | ok | 7.18 | 3.18 Volts
VCPU | 34h | ok | 3.2 | 1.28 Volts
P1V2_VDDQ | 35h | ok | 32.1 | 1.21 Volts
P5V_DUAL | 38h | ok | 7.15 | 4.97 Volts
3.3VSB | 39h | ok | 7.12 | 3.35 Volts
PVCC_VCCSA | 3Ch | ok | 7.21 | 1.05 Volts
P1V2_STBY | 3Dh | ok | 7.22 | 1.27 Volts
VPCH 1.0V | 3Eh | ok | 7.5 | 1 Volts
Chassis Intru | AAh | ok | 23.1 |

Fantastic! Really

Now, does anybody have a clue on how to pass this info to HA??

Thanks very much

Luca

This is the correct string
Sorry

ipmitool -I lanplus -H IPADDR -U user -P pswrd sdr elist full

try the commandline sensor

Thanks for the answer…
I saw that option, but I am absolutely not sure about how to integrate it…
And… I found pretty strange nobody is using IPMI with HA…

Use the search function.

Thanks for the answer. What does it mean?

It means go to the top of this page and use the search function, there are at least 3 other threads here mentioning ipmi.

Now a sensor senses one thing. Create a command line for each quantity you want to measure. Then use the commandline sensor for each one.

If you have python experience you could write a IPMI (custom) component. There is python ipmi library that you could use. https://github.com/kontron/python-ipmi


Heiko

thanks guys!
I reached this result as suggested by nickrout:
ipmitool -I lanplus -H 192.168.2.97 -U ADMIN -P ADMIN sdr entity 8.1

with this output:
VcpuVRM Temp | 10h | ok | 8.1 | 52 degrees C

but
i am not able to just take the number of the temp: 52.
the template i am using:
value_template: ‘{{value | truncate (20) | multiply(0.001) | round(1) }}’

is giving me this result:
CPU Temperature ‘VcpuVRM Temp …’ °C

that means that i am able to truncate some part of the result but I cannot get what i want… the number of the temperature!!! :sob:

Any idea on how to do it? do I need to pass through a file?

@hthiery: I am really NOT familiar at all with python ipmi library… i could try… does it work also form extracting ipmi value from another server different from the one in which i run HA?

thanks very much guys…

Luca

How about adding the following to the end of the ipmitool line

|cut -d '|' -f 5|cut -d ' ' -f1

Or something like that! See https://linux.die.net/man/1/cut

Or if you want to do it in the template, take a look at this example

Guys… it woooooooooorks!!! exactly using cut and getting of all template!
Here the code in HA:

  • platform: command_line
    name: CPU temp
    command: ipmitool -I lanplus -H 192.168.2.97 -U ADMIN -P ADMIN sdr entity 3.1 | cut -c 38-40
    unit_of_measurement: “°C”

@nickrout thanks for all suggestion, now i will start having dun with some automation!!!
I will bother you again if I need help!

Luca

Not sure what will happen if temp goes under 10 or over 99.

I think is going to recognize it because i took 3 characters and the value is a number… actually I ask myself the same question… but I will test it and let you know…

Hello all, I know this is a old thread but I am not able to get ipmitool running through YAML. It works if I download it via apk and run in a terminal or SSH to the addon, not core. I read that Home Assistant runs in it own docker but I do not see where I can load the ipmitool so that it can run with automation. I get command not found in the server logs.

Thanks for anyone still out there and has this working.

What does it mean “running through YAML”?

Use the addon “ssh and web terminal”

In this setting line put the apk packages you need:

packages: []

Then the package will be installed into home assistant and you can use them in a commandline sensor.

When I try to add a sensor using the command_line platform it does not work. in the logs it says command not found. If I run the same command from a normal ssh or terminal session it works fine.

Trying now to see if I can call a script and pull the value into HA.

Thanks for the type but I still get

/bin/sh: ipmitool: not found

in the System ->Core Log Provider

Added to Terminal & SSH Configuration

packages:
  - ipmitool

Now I get this in the Server Supervisor log
21-01-11 15:30:09 WARNING (MainThread) [supervisor.addons.validate] Unknown options packages

and same for Core error ipmitool: not found

Thanks
Derek

and this in Terminal when trying to just test there

bash: ipmitool: command not found