#!/usr/bin/env python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | # | | |___| | | | __/ (__| < | | | | . \ | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | # | | # | Copyright Mathias Kettner 2018 mk@mathias-kettner.de | # +------------------------------------------------------------------+ # # This file is part of Check_MK. # The official homepage is at http://mathias-kettner.de/check_mk. # # check_mk is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation in version 2. check_mk is distributed # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public License for more de- # tails. You should have received a copy of the GNU General Public # License along with GNU Make; see the file COPYING. If not, write # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. import re import sys, getopt import requests import xml.etree.ElementTree as ET from requests.packages.urllib3.exceptions import InsecureRequestWarning # pylint: disable=import-error def usage(): sys.stderr.write("""Check_MK VMWare NSX USAGE: agent_nsx [OPTIONS] HOST OPTIONS: -h, --help Show this help message and exit --address Host address --user Username --password Password --no-cert-check Disable certificate check --nsx_resource List of nsx resources """) sys.exit(1) short_options = "h" long_options = ["help", "username=", "password=", "address=", "demo", "no-cert-check" , "nsx_resource="] try: opts, args = getopt.getopt(sys.argv[1:], short_options, long_options) except getopt.GetoptError, err: sys.stderr.write("%s\n" % err) sys.exit(1) opt_demo = False opt_cert = True args_dict = {} resources = [] for o,a in opts: if o in [ "--address" ]: args_dict["address"] = a elif o in [ "--username" ]: args_dict["username"] = a elif o in [ "--password" ]: args_dict["password"] = a elif o in [ "--demo" ]: opt_demo = True elif o in [ "--no-cert-check" ]: opt_cert = False elif o in [ "--nsx_resource"]: resources.append(a) elif o in [ "-h", "--help" ]: usage() def query(url): if opt_cert == False: requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # pylint: disable=no-member response = requests.get(url, verify=opt_cert, auth=(args_dict["username"], args_dict["password"]), headers={'Accept':'application/xml'}) raw_xml = response.text # Remove namespace nonsense if "uptime" in str(url): return raw_xml else: raw_xml = re.sub(' xml="[^"]+"', '', raw_xml, count=1) xml_instance = ET.fromstring(raw_xml) return xml_instance output_lines = [] def output(line): output_lines.append(line) def process_edge_info(): output("<<>>") xml_instance = query_edges() if xml_instance.iter('edgeSummary'): tbody = xml_instance.iter('edgeSummary') for child in tbody: name=child.find('name').text edgeid=child.find('id').text edgestatus=child.find('edgeStatus').text edgestate=child.find('state').text edgetype=child.find('edgeType').text output("%s\t%s\t%s\t%s\t%s" % (name, edgeid, edgestatus, edgestate, edgetype)) def process_controller_info(): output("<<>>") xml_instance = query_controllers() if xml_instance.iter('controller'): tbody = xml_instance.iter('controller') for child in tbody: name=child.find('name').text controllerid=child.find('id').text controllerstatus=child.find('status').text output("%s\t%s\t%s" % (name, controllerid, controllerstatus)) def process_nsx_components_info(): output("<<>>") xml_instance = query_nsx_components() if xml_instance.iter('component'): tbody = xml_instance.iter('component') for child in tbody: component_name=child.find('name').text component_id=child.find('componentId').text component_status=child.find('status').text output("%s\t%s\t%s" % (component_name, component_id, component_status)) def process_nsx_backup_info(): output("<<>>") xml_instance = query_nsx_backup() if xml_instance.iter('backupFileProperties'): tbody = xml_instance.iter('backupFileProperties') for child in tbody: backup_file = child.find('fileName').text backup_size = child.find('fileSize').text backup_creationtime=child.find('creationTime').text output("%s\t%s\t%s" % (backup_file, backup_size, backup_creationtime)) def process_nsx_cpu(): output("<<>>") xml_instance = query_nsx_cpu() if xml_instance.iter('cpuinfo'): tbody = xml_instance.iter('cpuInfo') for child in tbody: totalNoOfCPUs = child.find('totalNoOfCPUs').text capacity = child.find('capacity').text usedCapacity=child.find('usedCapacity').text freeCapacity = child.find('freeCapacity').text usedPercentage = child.find('usedPercentage').text output("totalNoOfCPUs %s\ncapacity %s\nusedCapacity %s\nfreeCapacity %s\nusedPercentage %s" % (totalNoOfCPUs, capacity, usedCapacity, usedCapacity, usedPercentage )) def process_nsx_memory(): output("<<>>") xml_instance = query_nsx_memory() if xml_instance.iter('memInfo'): tbody = xml_instance.iter('memInfo') for child in tbody: totalMemory = child.find('totalMemory').text usedMemory = child.find('usedMemory').text freeMemory=child.find('freeMemory').text usedPercentage = child.find('usedPercentage').text output("TotalMem %s\nUsedMemory %s\nFreeMemory %s\nUsedPercentage %s" % (totalMemory, usedMemory, freeMemory, usedPercentage)) def process_nsx_uptime(): output("<<>>") seconds = 0 uptime=query_nsx_uptime() raw_text=uptime.split() uptime=[] for word in raw_text: element = re.sub(',','',word,count =1) uptime.append(element) if "year" in uptime: seconds = int(31536000) * int(uptime[int(uptime.index("year"))-1]) if "days" in uptime: seconds += int(86400) * int(uptime[int(uptime.index("days"))-1]) if "hours" in uptime: seconds += int(3600) * int(uptime[int(uptime.index("hours"))-1]) if "minutes" in uptime: seconds += int(60) * int(uptime[int(uptime.index("minutes"))-1]) output(str(seconds)) def process_nsx_vcenter_connection(): output("<<>>") xml_instance = query_nsx_vcenter_connection() if xml_instance.iter('vcConfigStatus'): tbody = xml_instance.iter('vcConfigStatus') for child in tbody: connected = child.find('connected').text output("vCenterConnection %s" % (connected)) def process_nsx_storage_info(): output("<<>>") xml_instance = query_nsx_storage_info() if xml_instance.iter('storageInfo'): tbody = xml_instance.iter('storageInfo') for child in tbody: totalStorage = child.find('totalStorage').text usedStorage = child.find('usedStorage').text freeStorage=child.find('freeStorage').text usedPercentage = child.find('usedPercentage').text output("TotalStorage %s\nUsedStorage %s\nFreeStorage %s\nUsedPercentage %s" % (totalStorage, usedStorage, freeStorage, usedPercentage)) def process_nsx_resource_info(): output("<<>>") for i in range(len(resources)): xml_instance = query_nsx_resources(resources[i]) if xml_instance.iter('resourceStatuses'): tbody = xml_instance.iter('resourceStatus') for child in tbody: hostRebootRequired = child.find('hostRebootRequired').text output("%s\thostRebootRequired\t%s" % ( resources[i], hostRebootRequired) ) feature_statuses = child.iter('nwFabricFeatureStatus') for feature in feature_statuses: featureId = feature.find('featureId').text featurestatus = feature.find('status').text output("%s\t%s\t%s" % (resources[i], featureId, featurestatus)) def query_edges(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', edge_status, count=1) return ET.fromstring(edge_status) url = "https://%(address)s/api/4.0/edges" % args_dict return query(url) def query_controllers(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', controllers, count=1) return ET.fromstring(controllers) url = "https://%(address)s/api/2.0/vdn/controller" % args_dict return query(url) def query_nsx_components(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_components, count=1) return ET.fromstring(nsx_components) url = "https://%(address)s/api/1.0/appliance-management/summary/components" % args_dict return query(url) def query_nsx_backup(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', backup, count=1) return ET.fromstring(backup) url = "https://%(address)s/api/1.0/appliance-management/backuprestore/backups" % args_dict return query(url) def query_nsx_memory(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_memory, count=1) return ET.fromstring(nsx_memory) url = "https://%(address)s/api/1.0/appliance-management/system/meminfo" % args_dict return query(url) def query_nsx_cpu(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_cpu, count=1) return ET.fromstring(nsx_cpu) url = "https://%(address)s/api/1.0/appliance-management/system/cpuinfo" % args_dict return query(url) def query_nsx_uptime(): if opt_demo: return nsx_uptime url = "https://%(address)s/api/1.0/appliance-management/system/uptime" % args_dict return query(url) def query_nsx_vcenter_connection(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_vcenter_connection, count=1) return ET.fromstring(nsx_vcenter_connection) url = "https://%(address)s/api/2.0/services/vcconfig/status" % args_dict return query(url) def query_nsx_storage_info(): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_storage_info, count=1) return ET.fromstring(nsx_storage_info) url = "https://%(address)s/api/1.0/appliance-management/system/storageinfo" % args_dict return query(url) def query_nsx_resources(resource): if opt_demo: raw_xml = re.sub(' xml="[^"]+"', '', nsx_resource_domain_c7, count=1) return ET.fromstring(nsx_resource_domain_c7) uri = "api/2.0/nwfabric/status?resource=%s" % resource url_1 = "https://%(address)s/" % args_dict url = "%s%s" % (url_1, uri) return query(url) def main(): try: # Get edges info process_edge_info() # Get Controllers info process_controller_info() # Get NSX Components process_nsx_components_info() # Get NSX Backup process_nsx_backup_info() # Get NSX Memory Usage process_nsx_memory() # Get NSX CPU Usage process_nsx_cpu() # Get Uptime process_nsx_uptime() # Get vCenter Conneciton process_nsx_vcenter_connection() # Get Storage info process_nsx_storage_info() # get Resources info process_nsx_resource_info() sys.stdout.write("\n".join(output_lines) + "\n") except Exception, e: sys.stderr.write("Connection error: %s" % e) sys.exit(1) edge_status = \ """ 256 0 5 true id edge-1 Edge 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 17 Edge clj01psc01 false 0 false edge-1 deployed gatewayServices datacenter-2 clj01-m01dc default 4.0 GREEN 1 6.3.4 6.3.4-6795877 large clj01psc01.test 2 0 vm-42 clj01psc01-0 host-21 clj01m01esx03.test resgroup-8 Resources datastore-12 clj01-m01-ds01 1528198369821 msgbus-msgbus false false Change Log Level Add Edge Appliance Delete Edge Appliance Edit Edge Appliance Edit CLI Credentials Change FIPS mode Change edge appliance size Force Sync Redeploy Edge Change Edge Appliance Core Dump Configuration Enable hypervisorAssist Edit Highavailability Edit Dns Edit Syslog Edit Automatic Rule Generation Settings Disable SSH Download Edge TechSupport Logs edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae Edge 42220EB5-0574-A0A4-031B-1DA658998F9E 8a3ecfae-a3dd-4558-91b6-7430419e174b 8 Edge uni01w01dlrbuc01-X_DMZA true 0 false edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae active distributedRouter default 4.0 jobdata-63834 SUCCESS GREY 2 6.3.4 compact NSX-edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae 0 true edge-2 Edge 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 21 Edge clj01m01esg01 false 0 false edge-2 deployed gatewayServices datacenter-2 clj01-m01dc default 4.0 GREEN 3 6.3.4 6.3.4-6795877 large clj01m01esg01.test 1 0 vm-46 clj01m01esg01-0 host-10 clj01m01esx01.test resgroup-8 Resources datastore-12 clj01-m01-ds01 1528198355972 msgbus false false Change Log Level Add Edge Appliance Delete Edge Appliance Edit Edge Appliance Edit CLI Credentials Change FIPS mode Change edge appliance size Force Sync Redeploy Edge Change Edge Appliance Core Dump Configuration Enable hypervisorAssist Edit Highavailability Edit Dns Edit Syslog Edit Automatic Rule Generation Settings Disable SSH Download Edge TechSupport Logs edge-3 Edge 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 15 Edge clj01m01esg02 false 0 false edge-3 deployed gatewayServices datacenter-2 clj01-m01dc default 4.0 GREEN 3 6.3.4 6.3.4-6795877 large clj01m01esg02.test 1 0 vm-47 clj01m01esg02-0 host-20 clj01m01esx02.test resgroup-8 Resources datastore-12 clj01-m01-ds01 1528198356967 msgbus false false Change Log Level Add Edge Appliance Delete Edge Appliance Edit Edge Appliance Edit CLI Credentials Change FIPS mode Change edge appliance size Force Sync Redeploy Edge Change Edge Appliance Core Dump Configuration Enable hypervisorAssist Edit Highavailability Edit Dns Edit Syslog Edit Automatic Rule Generation Settings Disable SSH Download Edge TechSupport Logs edge-4 Edge 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 21 Edge clj01m01lb01 false 0 false edge-4 deployed gatewayServices datacenter-2 clj01-m01dc default 4.0 jobdata-25970 SUCCESS GREEN 2 6.3.4 6.3.4-6795877 large clj01m01lb01.test 2 1 vm-68 clj01m01lb01-1 host-20 clj01m01esx02.test resgroup-8 Resources datastore-11 clj01-m01-ds03 1528198325165 msgbus-msgbus false false Change Log Level Add Edge Appliance Delete Edge Appliance Edit Edge Appliance Edit CLI Credentials Change FIPS mode Change edge appliance size Force Sync Redeploy Edge Change Edge Appliance Core Dump Configuration Enable hypervisorAssist Edit Highavailability Edit Dns Edit Syslog Edit Automatic Rule Generation Settings Disable SSH Download Edge TechSupport Logs edge-2c8970e8-14f4-40f1-a684-9971976b730e Edge 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 13 Edge buc01m01udlr01 true 0 false edge-2c8970e8-14f4-40f1-a684-9971976b730e deployed distributedRouter default 4.0 jobdata-25968 SUCCESS GREEN 4 6.3.4 6.3.4-6795877 compact NSX-edge-2c8970e8-14f4-40f1-a684-9971976b730e 2 0 vm-303 edge-2c8970e8-14f4-40f1-a684-9971976b730e-0-buc01m01udlr01 host-21 clj01m01esx03.test resgroup-8 Resources datastore-12 clj01-m01-ds01 1528198329144 msgbus-msgbus false false Change Log Level Add Edge Appliance Delete Edge Appliance Edit Edge Appliance Edit CLI Credentials Change FIPS mode Force Sync Redeploy Edge Change Edge Appliance Core Dump Configuration Edit Highavailability Edit Dns Edit Syslog Disable SSH Download Edge TechSupport Logs 30000 default+edge-2c8970e8-14f4-40f1-a684-9971976b730e ffcbdd18-6397-489c-a94f-19761b811d81 TransportZone universalvdnscope """ controllers = \ """ Controller 0 clj01m01nsxc01 clj01m01nsxc01 false 0 controller-47 172.19.133.51 RUNNING NOT_STARTED 6.3.7087288 true vm-301 VirtualMachine 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 7 VirtualMachine NSX_Controller_70ef8503-f49b-478f-96bb-08cd01bd3558 domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 host-21 HostSystem 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 3016 HostSystem clj01m01esx03.test domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 resgroup-8 ResourcePool 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 153 ResourcePool Resources domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 domain-c7 ClusterComputeResource 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 9 ClusterComputeResource clj01-m01-mgmt01 datacenter-2 Datacenter clj01-m01dc false 0 42224242-869B-7AA0-5855-FD2C6ADF7451 false datastore-12 Datastore 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 2 Datastore clj01-m01-ds01 false 0 controller-47 172.19.133.51 172.19.133.52 true SUCCESS 1528198790434 FALSE POWERED_ON Controller 0 clj01m01nsxc01 clj01m01nsxc01 false 0 controller-48 172.19.133.52 RUNNING NOT_STARTED 6.3.7087288 true vm-302 VirtualMachine 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 7 VirtualMachine NSX_Controller_cdecc3f5-11c5-461f-b6a8-e980dcc83cc4 domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 host-21 HostSystem 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 3016 HostSystem clj01m01esx03.test domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 resgroup-8 ResourcePool 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 153 ResourcePool Resources domain-c7 ClusterComputeResource clj01-m01-mgmt01 false 0 domain-c7 ClusterComputeResource 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 9 ClusterComputeResource clj01-m01-mgmt01 datacenter-2 Datacenter clj01-m01dc false 0 42224242-869B-7AA0-5855-FD2C6ADF7451 false datastore-12 Datastore 42224242-869B-7AA0-5855-FD2C6ADF7451 feec058e-c396-4c37-96d2-a7169e92622a 2 Datastore clj01-m01-ds01 false 0 controller-48 172.19.133.52 172.19.133.51 true SUCCESS 1528198790484 FALSE POWERED_ON """ nsx_components = \ """ COMMON VPOSTGRES vPostgres vPostgres - Database service RUNNING true false NSX COMMON RABBITMQ RabbitMQ RabbitMQ - Messaging service RUNNING true false NSX COMMON NSXGRP NSXREPLICATOR NSX Replicator NSX Replicator RUNNING true false NSX NSXGRP NSX NSX Manager NSX Manager RUNNING true true VPOSTGRES RABBITMQ NSXREPLICATOR NSXGRP 6 3 4 7087695 SYSTEM SSH SSH Service Secure Shell RUNNING true false SYSTEM """ backup = \ """ clj01m01nsx01_00_00_00_Tue05Jun2018 3614752 1528156800000 clj01m01nsx01_00_00_00_Sun03Jun2018 3553312 1527984000000 clj01m01nsx01_00_00_00_Sat02Jun2018 3532832 1527897600000 clj01m01nsx01_00_00_00_Thu31May2018 3491872 1527724800000 clj01m01nsx01_00_00_00_Wed30May2018 3471392 1527638400000 clj01m01nsx01_00_00_00_Tue29May2018 3450912 1527552000000 clj01m01nsx01_00_00_00_Mon28May2018 3430432 1527465600000 clj01m01nsx01_00_00_00_Sun27May2018 3420192 1527379200000 clj01m01nsx01_00_00_00_Sat26May2018 3399712 1527292800000 clj01m01nsx01_00_00_00_Fri25May2018 3389472 1527206400000 clj01m01nsx01_00_00_00_Thu24May2018 3328032 1527120000000 clj01m01nsx01_00_00_00_Tue22May2018 3266592 1526947200000 clj01m01nsx01_00_00_00_Mon21May2018 3246112 1526860800000 clj01m01nsx01_00_00_00_Sun20May2018 3225632 1526774400000 clj01m01nsx01_00_00_00_Sat19May2018 3205152 1526688000000 clj01m01nsx01_00_00_00_Fri30Mar2018 2109472 1522368000000 clj01m01nsx01_00_00_00_Fri18May2018 3184672 1526601600000 clj01m01nsx01_00_00_00_Thu29Mar2018 2088992 1522281600000 clj01m01nsx01_00_00_00_Thu17May2018 3153952 1526515200000 clj01m01nsx01_00_00_00_Wed28Mar2018 2058272 1522195200000 clj01m01nsx01_00_00_00_Wed16May2018 3143712 1526428800000 clj01m01nsx01_00_00_00_Tue27Mar2018 2037792 1522108800000 clj01m01nsx01_23_59_58_Mon14May2018 3143712 1526342398000 clj01m01nsx01_00_00_00_Mon26Mar2018 2017312 1522022400000 clj01m01nsx01_00_00_00_Mon14May2018 3143712 1526256000000 clj01m01nsx01_00_00_00_Sun25Mar2018 1996832 1521936000000 clj01m01nsx01_00_00_00_Sun13May2018 3112992 1526169600000 clj01m01nsx01_00_00_00_Sat24Mar2018 1976352 1521849600000 clj01m01nsx01_00_00_00_Sat12May2018 3133472 1526083200000 clj01m01nsx01_00_00_00_Fri23Mar2018 1996832 1521763200000 clj01m01nsx01_00_00_00_Thu22Mar2018 1914912 1521676800000 clj01m01nsx01_00_00_00_Thu10May2018 3072032 1525910400000 clj01m01nsx01_00_00_00_Wed21Mar2018 1822752 1521590400000 clj01m01nsx01_00_00_00_Wed09May2018 3051552 1525824000000 clj01m01nsx01_00_00_00_Tue20Mar2018 1740832 1521504000000 clj01m01nsx01_00_00_00_Tue08May2018 2990112 1525737600000 clj01m01nsx01_00_00_00_Mon19Mar2018 1658912 1521417600000 clj01m01nsx01_00_00_00_Mon07May2018 2928672 1525651200000 clj01m01nsx01_00_00_00_Sun18Mar2018 1576992 1521331200000 clj01m01nsx01_00_00_00_Sun06May2018 2908192 1525564800000 clj01m01nsx01_00_00_00_Sat17Mar2018 1495072 1521244800000 clj01m01nsx01_00_00_00_Sat05May2018 2887712 1525478400000 clj01m01nsx01_00_00_00_Fri16Mar2018 1402912 1521158400000 clj01m01nsx01_00_00_00_Fri04May2018 2867232 1525392000000 clj01m01nsx01_00_00_00_Thu15Mar2018 1320992 1521072000000 clj01m01nsx01_00_00_00_Wed14Mar2018 1228832 1520985600000 clj01m01nsx01_00_00_00_Tue13Mar2018 1146912 1520899200000 clj01m01nsx01_00_00_00_Mon12Mar2018 1064992 1520812800000 clj01m01nsx01_00_00_00_Sun11Mar2018 993312 1520726400000 clj01m01nsx01_23_59_58_Fri09Mar2018 911392 1520639998000 clj01m01nsx01_23_59_58_Thu08Mar2018 778272 1520553598000 clj01m01nsx01_00_00_00_Thu08Mar2018 665632 1520467200000 clj01m01nsx01_08_21_01_Wed07Mar2018 532512 1520410861000 clj01m01nsx01_00_00_00_Mon04Jun2018 3573792 1528070400000 clj01m01nsx01_00_00_00_Fri01Jun2018 3512352 1527811200000 """ nsx_memory = \ """ 16025 MB 5233 MB 10792 MB 33 """ nsx_cpu = \ """ 4 2196 MHZ 17 MHZ 2179 MHZ 1 """ nsx_vcenter_connection = \ """ true 1528202184756 """ nsx_storage_info = \ """ 81G 4.1G 77G 5 """ nsx_uptime = "7 days, 7 minutes" nsx_resource_domain_c7 = \ """ domain-c7 ClusterComputeResource 4220F930-D7C1-D623-88EC-FB40297018CF b473ae67-65db-48cb-ac8d-069e43df1c52 12 ClusterComputeResource buc01-m01-mgmt01 datacenter-2 Datacenter buc01-m01dc false 0 false com.vmware.vshield.vsm.nwfabric.hostPrep 6.3.4.7087695 false GREEN true true false com.vmware.vshield.vsm.vdr_mon 5.5 false UNKNOWN false true false com.vmware.vshield.vsm.vxlan 5.5 false GREEN true true false com.vmware.vshield.vsm.messagingInfra false GREEN true true false com.vmware.vshield.firewall 5.5 false GREEN true true false """ if __name__ == "__main__": main()