How to use pyVmomi SDK for vSphere 7.0U3 to fetchAuditRecords
Install pyVmomi SDK
First, you'll need a functioning Python environment. This may differ by operating system and distribution.
You need the pyVmomi SDK module inside your pypath and then import the module in your Python code.
To install the pyVmomi PyPI package:
% pip3 install pyvmomi
(pip3 is for Python 3 or higher)
Or if there is an older version already installed:
% pip3 install pyvmomi -upgrade
Please check the pyVmomi samples for usage examples: https://gitlab.eng.vmware.com/api-platform/pyvmomi-community-samples
Run audit.py
Make audit.py file executable (chmod +x audit.py).
To get info on audit.py input parms:
% ~/tmp$ ./audit.py --help usage: Display locally stored audit records. [-h] --host HOST --password PASSWORD --user USER
optional arguments: -h, --help show this help message and exit --host HOST The IP address of the ESXi host --password PASSWORD Password to log in with --user USER User name to log in with
Run to talk to ESXi box:
% ./audit.py --host IP_addr --user root --password ""