Skip to content

Latest commit

 

History

History
107 lines (91 loc) · 2.96 KB

VmwareExporter.md

File metadata and controls

107 lines (91 loc) · 2.96 KB

VMWARE exporter for later

Table of Content

  1. Install Openssl
  2. Install Python
  3. References

Install openssl

Requirements: >=Python 3.6, newest openssl

  1. Download python3 source from offical website
  2. Download openssl source from offical website
sudo yum install zlib-devel perl-Test-Simple 
tar zxvf openssl-*.tar.gz
cd cd openssl-*
./config --prefix=/opt/openssl --openssldir=/opt/openssl no-ssl2
make
make test

If Failed test 'running ssl_test 12-ct.cnf' occured, ignore it (fix in next patch)

sudo make install

Add to PATH environment

1.Find out the name of openssl lib directory (lib64/lib)

export PATH=/opt/openssl/bin:$PATH
export LD_LIBRARY_PATH=/opt/openssl/lib64
export LC_ALL="en_US.UTF-8"
export LDFLAGS="-L /opt/openssl/lib64 -Wl,-rpath,/opt/openssl/lib64"
. ~/.bash_profile

Confirm openssl installation

which openssl
/opt/openssl/bin/openssl
[leele3@] openssl version
OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)

Install Python

Step1. Extract tarball

tar -zxvf Python-3.?.?.tar.xz

Step2. Enable SSL by default

vi ./Python-3*/Modules/Setup.dist

Step3. Search for “SSL” and uncomment the code as shown below

_socket socketmodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/opt/openssl
_ssl _ssl.c \
 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
 -L$(SSL)/lib -lssl -lcrypto

Step4. Configure python installation script

cd {Python script path}
./configure
make
sudo make altinstall or install

Step5. Check for ssl support

python3.6
import ssl

Step6. If ssl import error still existing (Optional)

This normally happened when multiple openssl version installed Need to customize Python3 setup script

  1. Modify python3 setup.py following this link
  2. Configure Python3 installation script again
cd {python script directory}
./configure --with-openssl=/opt/ (no need openssl directory)
make 
sudo make altinstall or install

Step7. Install vmware exporter

1.download release from github page
2.extract tarball

sudo env "PATH=$PATH" python3.6 setup.py install

References

  1. Openssl Requirement
  2. Install Python3 on Redhat
  3. VMware exporter
  4. Setup.py modify
  5. Coredump when compiling python with a custom openssl version