RESOLVED: Issue checking Vmware Hosts after uogarding to the lates version
RESOLVED: Issue checking Vmware Hosts after uogarding to the lates version
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?
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
Hi @slawek, thanks for reaching out.
What version of Python 3 is running on your XI server?
In a terminal window...
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
-Laura
-
gwesterman
- Posts: 269
- Joined: Wed Aug 23, 2023 11:29 am
Re: Issue checking Vmware Hosts after uogarding to the lates version
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!
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
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.
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
You should be able to upgrade like this:
Code: Select all
apt upgrade python3-pyvmomiRe: Issue checking Vmware Hosts after uogarding to the lates version
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).
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
Hi @slawek,
Try this:
Let us know if that works for you.
Thank you!
Try this:
Code: Select all
apt install python3.12-venv
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pyvmomi
Thank you!
Re: Issue checking Vmware Hosts after uogarding to the lates version
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
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
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.