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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
slawek
Posts: 7
Joined: Fri Nov 20, 2020 3:31 pm

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

Post 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?
User avatar
lgute
Posts: 420
Joined: Mon Apr 06, 2020 2:49 pm

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

Post 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
Please let us know if you have any other questions or concerns.

-Laura
slawek
Posts: 7
Joined: Fri Nov 20, 2020 3:31 pm

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

Post by slawek »

Python 3.12.3
gwesterman
Posts: 269
Joined: Wed Aug 23, 2023 11:29 am

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

Post 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!
slawek
Posts: 7
Joined: Fri Nov 20, 2020 3:31 pm

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

Post 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.
jsimon
Posts: 343
Joined: Wed Aug 23, 2023 11:27 am

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

Post by jsimon »

You should be able to upgrade like this:

Code: Select all

apt upgrade python3-pyvmomi
slawek
Posts: 7
Joined: Fri Nov 20, 2020 3:31 pm

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

Post 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).
gwesterman
Posts: 269
Joined: Wed Aug 23, 2023 11:29 am

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

Post 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!
slawek
Posts: 7
Joined: Fri Nov 20, 2020 3:31 pm

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

Post 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
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

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

Post by bbahn »

Hello @slawek,

Can you run

Code: Select all

python -m pip list
and post the contents here?
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Locked