Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to link to ipmitool #6

Closed
MoLing-Dong opened this issue Jun 25, 2023 · 24 comments
Closed

Unable to link to ipmitool #6

MoLing-Dong opened this issue Jun 25, 2023 · 24 comments

Comments

@MoLing-Dong
Copy link

2023-06-25 21:48:54.262 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ui_lovelace_minimalist which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.263 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration midea_ac which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.263 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration midea_dehumidifier_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.263 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration midea_ac_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.263 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.264 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration esxi_stats which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.264 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration colorfulclouds which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:48:54.265 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ipmi which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-06-25 21:50:40.945 ERROR (SyncWorker_0) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.11: timed out
2023-06-25 21:50:58.077 ERROR (SyncWorker_2) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.11: timed out
2023-06-25 21:51:55.040 ERROR (SyncWorker_2) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.11: timed out
2023-06-25 21:53:00.480 ERROR (SyncWorker_3) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10: timed out
2023-06-25 21:53:14.673 ERROR (SyncWorker_6) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10: timed out
2023-06-25 21:53:35.898 ERROR (SyncWorker_3) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10: timed out
2023-06-25 21:56:13.436 WARNING (MainThread) [homeassistant.config_entries] Config entry 'server@192.168.0.10:623' for ipmi integration not ready yet; Retrying in background
2023-06-25 21:56:21.049 ERROR (SyncWorker_2) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 21:56:32.821 ERROR (MainThread) [frontend.js.latest.202306080] http://192.168.0.13:8123/frontend_latest/17827-INquOPjPYjM.js:1:92700 Uncaught TypeError: Cannot read properties of null (reading 'removeEventListener')
2023-06-25 21:56:40.332 ERROR (SyncWorker_1) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 21:56:40.361 ERROR (SyncWorker_5) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 21:57:09.002 ERROR (SyncWorker_6) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 21:59:29.496 DEBUG (MainThread) [custom_components.ipmi] Finished fetching IPMI resource status data in 10.002 seconds (success: False)
2023-06-25 22:02:05.420 ERROR (SyncWorker_1) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 22:03:02.504 WARNING (MainThread) [homeassistant.config_entries] Config entry 'RH2288V3@192.168.0.10:623' for ipmi integration not ready yet; Retrying in background
2023-06-25 22:03:10.027 ERROR (SyncWorker_2) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 22:03:10.134 ERROR (SyncWorker_4) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 22:03:49.413 ERROR (SyncWorker_3) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 22:03:57.594 ERROR (SyncWorker_3) [custom_components.ipmi] Error connecting to IPMI server 192.168.0.10:
2023-06-25 22:03:57.595 DEBUG (MainThread) [custom_components.ipmi] Finished fetching IPMI resource status data in 6.898 seconds (success: False)

image

@ateodorescu
Copy link
Owner

The integration uses the Python library python-ipmi to connect to IPMI servers which means that if that library can't connect to your server via RMCP interface then the integration won't work for you.

@ateodorescu
Copy link
Owner

I did another integration + addon

Please give them a try.

@MoLing-Dong
Copy link
Author

Sorry, why am I having trouble connecting to the plugin, showing that I can't connect

@ateodorescu
Copy link
Owner

Sorry, why am I having trouble connecting to the plugin, showing that I can't connect

I don't know. That python library does not work with all servers. A friend of mine reported that connection problem too and I don't know how to fix it since I depend on that python library. That's the reason I made another integration that uses an addon. The addon uses ipmitool executable to connect to servers and it's probably more reliable than the python library.

@35gh
Copy link

35gh commented Jun 29, 2023

That new integration does not work for me, I can't connect to the server (while connection works with ipmitool command line).

The add-on is installed and running.

 Logger: custom_components.ipmitool
Source: custom_components/ipmitool/__init__.py:234
Integration: IPMItool connector (documentation)
First occurred: 15:52:05 (2 occurrences)
Last logged: 15:52:39

    Error connecting to IPMI server 192.168.x.x: HTTPConnectionPool(host='localhost', port=9595): Max retries exceeded with url: /?host=192.168.x.x&port=623&user=xxx&password=yyy (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2b10d16d10>: Failed to establish a new connection: [Errno 111] Connection refused'))
    Error connecting to IPMI server 192.168.x.x: HTTPConnectionPool(host='localhost', port=9595): Max retries exceeded with url: /?host=192.168.x.x&port=623&user=xxx&password=yyy (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2b093f3250>: Failed to establish a new connection: [Errno 111] Connection refused'))

Note: it will be good to be able to choose either the RMCP or ipmitool connection, as RMCP does not requires an add-on if it works.

@ateodorescu
Copy link
Owner

That new integration does not work for me, I can't connect to the server (while connection works with ipmitool command line).

The add-on is installed and running.

 Logger: custom_components.ipmitool
Source: custom_components/ipmitool/__init__.py:234
Integration: IPMItool connector (documentation)
First occurred: 15:52:05 (2 occurrences)
Last logged: 15:52:39

    Error connecting to IPMI server 192.168.x.x: HTTPConnectionPool(host='localhost', port=9595): Max retries exceeded with url: /?host=192.168.x.x&port=623&user=xxx&password=yyy (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2b10d16d10>: Failed to establish a new connection: [Errno 111] Connection refused'))
    Error connecting to IPMI server 192.168.x.x: HTTPConnectionPool(host='localhost', port=9595): Max retries exceeded with url: /?host=192.168.x.x&port=623&user=xxx&password=yyy (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2b093f3250>: Failed to establish a new connection: [Errno 111] Connection refused'))

Note: it will be good to be able to choose either the RMCP or ipmitool connection, as RMCP does not requires an add-on if it works.

In the addon configuration did you change the port number? please let the default value 9595.

@ateodorescu
Copy link
Owner

Is there any error in the addon's log?

@35gh
Copy link

35gh commented Jun 29, 2023

My bad, the add-on was not correctly installed. I've removed / reinstalled and now I can add my server.

However the custom integration fails with a different error:

Logger: homeassistant.config_entries
Source: custom_components/ipmitool/__init__.py:143
Integration: IPMItool connector (documentation)
First occurred: 16:17:32 (5 occurrences)
Last logged: 16:23:26
Error setting up entry server@192.168.x.x:623 for ipmitool

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 103, in async_setup_entry
    unique_id = alias + _unique_id_from_status(deviceInfo)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 143, in _unique_id_from_status
    serial = device_info.device["product_serial"]
             ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'product_serial'

@ateodorescu
Copy link
Owner

My bad, the add-on was not correctly installed. I've removed / reinstalled and now I can add my server.

However the custom integration fails with a different error:

Logger: homeassistant.config_entries
Source: custom_components/ipmitool/__init__.py:143
Integration: IPMItool connector (documentation)
First occurred: 16:17:32 (5 occurrences)
Last logged: 16:23:26
Error setting up entry server@192.168.x.x:623 for ipmitool

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 103, in async_setup_entry
    unique_id = alias + _unique_id_from_status(deviceInfo)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 143, in _unique_id_from_status
    serial = device_info.device["product_serial"]
             ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'product_serial'

would you please share the output of the ipmitool command fru? thanks!

@ateodorescu
Copy link
Owner

and bmc info please.

@35gh
Copy link

35gh commented Jun 29, 2023

Here you go:

ipmitool -I lanplus -H 192.168.x.x -U xxx -P yyy fru
FRU Device Description : Builtin FRU Device (ID 0)
 Board Mfg Date        : Mon Jan  1 01:00:00 1996
 Board Mfg             : Supermicro
 Board Serial          :           
 Product Serial        :      
ipmitool -I lanplus -H 192.168.x.x -U xxx -P yyy bmc info
Device ID                 : 32
Device Revision           : 1
Firmware Revision         : 3.88
IPMI Version              : 2.0
Manufacturer ID           : 10876
Manufacturer Name         : Supermicro
Product ID                : 2157 (0x086d)
Product Name              : Unknown (0x86D)
Device Available          : yes
Provides Device SDRs      : no
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    IPMB Event Generator
    Chassis Device
Aux Firmware Rev Info     : 
    0x00
    0x00
    0x00
    0x00

@ateodorescu
Copy link
Owner

I thought this info is the same for all servers but I guess not. I'll fix it when I find some time.

@ateodorescu
Copy link
Owner

please get latest for the ipmitool integration and check it out. thanks!

@35gh
Copy link

35gh commented Jun 29, 2023

That was quick, getting a different error now:

Logger: homeassistant.config_entries
Source: custom_components/ipmitool/__init__.py:120
Integration: IPMItool connector (documentation)
First occurred: 17:29:46 (2 occurrences)
Last logged: 17:30:25
Error setting up entry server@192.168.x.x:623 for ipmitool

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 120, in async_setup_entry
    manufacturer=data._device_info.device["product_manufacturer"],
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'product_manufacturer'

@ateodorescu
Copy link
Owner

That was quick, getting a different error now:

Logger: homeassistant.config_entries
Source: custom_components/ipmitool/__init__.py:120
Integration: IPMItool connector (documentation)
First occurred: 17:29:46 (2 occurrences)
Last logged: 17:30:25
Error setting up entry server@192.168.x.x:623 for ipmitool

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ipmitool/__init__.py", line 120, in async_setup_entry
    manufacturer=data._device_info.device["product_manufacturer"],
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'product_manufacturer'

sorry. get latest and try again please. :)
thanks for your patience.

@35gh
Copy link

35gh commented Jun 29, 2023

It works now!
I also get the power sensors, brilliant. Do you think you can add the "Sampling period" for power consumption as an entity?

@ateodorescu
Copy link
Owner

ateodorescu commented Jun 29, 2023 via email

@35gh
Copy link

35gh commented Jun 29, 2023

I mean that the "Sampling period" is missing from the list of sensors and I was wondering if it could be added. Thanks!

@ateodorescu
Copy link
Owner

ateodorescu commented Jun 29, 2023 via email

@ateodorescu
Copy link
Owner

I mean that the "Sampling period" is missing from the list of sensors and I was wondering if it could be added. Thanks!

Done!

@ateodorescu
Copy link
Owner

@MoLing-Dong You could try the other integration ipmitool and the ipmi-server addon to connect to your server. The RMCP connection used by the Python library from the ipmi integration does not work reliable with all servers.

@35gh
Copy link

35gh commented Jun 30, 2023

I mean that the "Sampling period" is missing from the list of sensors and I was wondering if it could be added. Thanks!

Done!

It works nicely, thank you!

@ateodorescu
Copy link
Owner

Can I close this ticket now? @MoLing-Dong @35gh ?

@35gh
Copy link

35gh commented Jun 30, 2023

It works for me on i386 platform, happy to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants