Page 1 of 2

RESOLVED: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Wed Nov 06, 2024 2:25 pm
by slawek
Hi,
I just upgraded to the latest version 2024R1.3 running on Ubuntu 24.04 LTS.

Now when Im trying to monitor Vmware Host using following command I'm getting following error:

python3 /usr/local/nagios/libexec/check_vsphere_xi.py -H "chi-esxi-01" -f "/usr/local/nagiosxi/etc/components/vsphere/chi_esxi_01_auth.txt" -l "CPU" "-w80" "-c90" "" "" "" ""
Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_vsphere_xi.py", line 8, in <module>
from pyVim import connect
File "/usr/lib/python3/dist-packages/pyVim/connect.py", line 37, in <module>
from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
File "/usr/lib/python3/dist-packages/pyVmomi/__init__.py", line 204, in <module>
from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \
File "/usr/lib/python3/dist-packages/pyVmomi/SoapAdapter.py", line 993, in <module>
_SocketWrapper = ssl.wrap_socket
^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'


Does anyone knows how to fix this issue?

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Wed Nov 06, 2024 3:00 pm
by lgute
Hi @slawek, thanks for reaching out.

What version of Python 3 is running on your XI server?

In a terminal window...

Code: Select all

python3 --version

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Wed Nov 06, 2024 3:03 pm
by slawek
Python 3.12.3

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Wed Nov 06, 2024 5:06 pm
by gwesterman
What version of of pyvmomi (the python package) is installed?

Try upgrading that package if it is less than 8.0.3.0.

Thank you!

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Thu Nov 07, 2024 10:13 am
by slawek
Hi, I just checked and I'm running latest available from repo. If i have to upgrade to the suggested version do you know how to do it?

apt-get install python3-pyvmomi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pyvmomi is already the newest version (6.7.1-6).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

When I'm trying to use pip to upgrade I'm getting following error and not sure how to solve it:

pip install --upgrade pyvmomi
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Thank you for your help on this issue.

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Thu Nov 07, 2024 10:37 am
by jsimon
You should be able to upgrade like this:

Code: Select all

apt upgrade python3-pyvmomi

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Thu Nov 07, 2024 11:46 am
by slawek
When I'm trying to use apt im getting this:

apt upgrade python3-pyvmomi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pyvmomi is already the newest version (6.7.1-6).

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Fri Nov 08, 2024 12:38 pm
by gwesterman
Hi @slawek,

Try this:

Code: Select all

apt install python3.12-venv
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pyvmomi
 
Let us know if that works for you.

Thank you!

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Mon Nov 11, 2024 12:11 pm
by slawek
Hello,
I was able to run all above commands and they completed successfully, however when I'm trying to run check again I'm getting same error as before

Re: Issue checking Vmware Hosts after uogarding to the lates version

Posted: Mon Nov 11, 2024 12:23 pm
by bbahn
Hello @slawek,

Can you run

Code: Select all

python -m pip list
and post the contents here?