openbmc / obmc-console

OpenBMC host console infrastructure
Apache License 2.0
18 stars 25 forks source link

Identify the status of IPMI SOL #24

Closed shivamurthyshastri closed 3 weeks ago

shivamurthyshastri commented 3 weeks ago

Hi all,

Do we have any way to identify status of IPMI SOL connection status in the BMC?

Example: for SSH SOL we can verify connection status using "netstat -tn" with port number 2200. Do we have something like this for IPMI SOL?

Note: we can not get any status with netstat tool for IPMI SOL.

Thanks, Shiva

mdmillerii commented 3 weeks ago

SOL session manager https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.cpp#L179 Creates a unix socket connection to \0bmc-console https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.cpp#L33 https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.hpp#L23

Which is the unix domain socket here https://github.com/openbmc/obmc-console?tab=readme-ov-file#underlying-design

I don't know if you could check the status through the change property interface , but it looks like netstat -x considering abstract sockets listing replace \0 with@ should work https://unix.stackexchange.com/questions/598886/is-there-a-command-to-list-all-abstract-unix-sockets-currently-open

The mentioned ss tool might require a kernel option https://github.com/openbmc/linux/blob/04b28a15e7e85be5a18b561988f8f36b233b577c/net/unix/Kconfig#L29 But you should be able to attach least look at ls /proc/NN/fd of the impi net instance to compare how many sockets are open.

amboar commented 3 weeks ago

Maybe lsof +E -p $(pidof netipmid) ?

mdmillerii commented 3 weeks ago

Note there's a instance per interface (if you have a dual network BMC)

shivamurthyshastri commented 3 weeks ago

SOL session manager https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.cpp#L179 Creates a unix socket connection to \0bmc-console https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.cpp#L33 https://github.com/openbmc/phosphor-net-ipmid/blob/8425624a9046f5a853e8596cc74441e622028494/sol/sol_manager.hpp#L23

Which is the unix domain socket here https://github.com/openbmc/obmc-console?tab=readme-ov-file#underlying-design

I don't know if you could check the status through the change property interface , but it looks like netstat -x considering abstract sockets listing replace \0 with@ should work https://unix.stackexchange.com/questions/598886/is-there-a-command-to-list-all-abstract-unix-sockets-currently-open

The mentioned ss tool might require a kernel option https://github.com/openbmc/linux/blob/04b28a15e7e85be5a18b561988f8f36b233b577c/net/unix/Kconfig#L29 But you should be able to attach least look at ls /proc/NN/fd of the impi net instance to compare how many sockets are open.

Thank you @mdmillerii. My issue is fixed with "netstat -x".