Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class VmwareCollector():
def __init__(
self,
host,
port,
username,
password,
collect_only,
Expand All @@ -68,6 +69,7 @@ def __init__(
):

self.host = host
self.port = port
self.username = username
self.password = password
self.ignore_ssl = ignore_ssl
Expand Down Expand Up @@ -575,6 +577,7 @@ def connection(self):
vmware_connect = yield threads.deferToThread(
connect.SmartConnect,
host=self.host,
port=self.port,
user=self.username,
pwd=self.password,
sslContext=context,
Expand Down Expand Up @@ -1883,6 +1886,7 @@ def configure(self, args):
self.config = {
'default': {
'vsphere_host': os.environ.get('VSPHERE_HOST'),
'vsphere_port': os.environ.get('VSPHERE_PORT', 443),
'vsphere_user': os.environ.get('VSPHERE_USER'),
'vsphere_password': os.environ.get('VSPHERE_PASSWORD'),
'ignore_ssl': get_bool_env('VSPHERE_IGNORE_SSL', False),
Expand Down Expand Up @@ -1910,6 +1914,7 @@ def configure(self, args):

self.config[section.lower()] = {
'vsphere_host': os.environ.get('VSPHERE_{}_HOST'.format(section)),
'vsphere_port': os.environ.get('VSPHERE_{}_PORT'.format(section), 443),
'vsphere_user': os.environ.get('VSPHERE_{}_USER'.format(section)),
'vsphere_password': os.environ.get('VSPHERE_{}_PASSWORD'.format(section)),
'ignore_ssl': get_bool_env('VSPHERE_{}_IGNORE_SSL'.format(section), False),
Expand Down Expand Up @@ -1968,6 +1973,7 @@ def generate_latest_metrics(self, request):

collector = VmwareCollector(
vsphere_host,
self.config[section]['vsphere_port'],
self.config[section]['vsphere_user'],
self.config[section]['vsphere_password'],
self.config[section]['collect_only'],
Expand Down