def __init__(self, order_id, parent, maintenance_policy, centered=False): soft_shutdown_timer = maintenance_policy.soft_shutdown_timer if soft_shutdown_timer not in [None, "never"]: soft_shutdown_timer += " seconds" rows = [[_("Description"), _("Value")], [_("Name"), maintenance_policy.name], [_("Description"), maintenance_policy.descr], [_("Organization"), maintenance_policy._parent._dn], [_("Reboot Policy"), maintenance_policy.reboot_policy], [_("Soft Shutdown Timer"), soft_shutdown_timer], [ _("Storage Config. Deployment Policy"), maintenance_policy.storage_config_deployment_policy ], [_("On Next Boot"), maintenance_policy.on_next_boot], [_("Schedule"), maintenance_policy.schedule]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, vmedia_mount, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), vmedia_mount["name"]], [_("Description"), vmedia_mount["descr"]], [_("Device Type"), vmedia_mount["device_type"]], [_("Protocol"), vmedia_mount["protocol"]], [ _("Authentication Protocol"), vmedia_mount["authentication_protocol"] ], [_("Hostname"), vmedia_mount["hostname"]], [ _("Image Name Variable"), vmedia_mount["image_name_variable"] ], [_("Remote File"), vmedia_mount["remote_file"]], [_("Remote Path"), vmedia_mount["remote_path"]], [_("Username"), vmedia_mount["username"]], [_("Password"), vmedia_mount["password"]], [_("Remap on Eject"), vmedia_mount["remap_on_eject"]], [_("Writable"), vmedia_mount["writable"]]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, bios_policy, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), bios_policy.name], [_("Description"), bios_policy.descr], [_("Organization"), bios_policy._parent._dn]] bios_table = bios_policy.get_bios_table() if not bios_table: self.logger(level="error", message="BIOS Table not imported.") if bios_table: for attr in sorted(bios_table, key=lambda x: bios_table[x]["param_name"], reverse=False): if getattr(bios_policy, attr) not in [ "platform-default", "Platform Default" ]: rows.append([ bios_table[attr]["param_name"], getattr(bios_policy, attr) ]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, config, device, centered=False): config_admin_networking = config.admin_networking[0] rows = [ [_("Description"), _("Value")], [_("System Name"), config_admin_networking.management_hostname], [_("Version"), config.device_version], [_("IP Address"), config_admin_networking.management_ipv4_address], [_("Netmask"), config_admin_networking.management_subnet_mask], [_("Gateway"), config_admin_networking.gateway_ipv4], [_("NIC Mode"), config_admin_networking.nic_mode] ] # Server info if config.server_properties: rows.append( [_("Asset Tag"), config.server_properties[0].asset_tag]) rows.append([_("Intersight Claim Status"), config.intersight_status]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[0]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, fis, centered=False, autofit=True): rows = [[ _("Fabric"), _("Fabric Port"), _("Remote Mgmt IP"), _("Remote WWNN"), _("Remote WWPN"), _("Transceiver SKU/Type"), _("Transceiver S/N"), _("Transceiver Length") ]] for fi in fis: for port in fi.ports: if port.type == "san": if hasattr(port, 'neighbor_entries'): if port.neighbor_entries: for neighbor_entry in port.neighbor_entries: fi_id = fi.id if port.aggr_port_id: fi_port = port.slot_id + "/" + port.aggr_port_id + "/" + port.port_id else: fi_port = port.slot_id + "/" + port.port_id fabric_mgmt_addr = neighbor_entry.fabric_mgmt_addr \ if neighbor_entry.fabric_mgmt_addr != "null" else None fabric_nwwn = neighbor_entry.fabric_nwwn fabric_pwwn = neighbor_entry.fabric_pwwn if len(port.transceivers) == 1: if port.transceivers[0].sku: transceiver_type = port.transceivers[ 0].sku else: transceiver_type = port.transceivers[ 0].type transceiver_sn = port.transceivers[ 0].serial transceiver_length = port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, fabric_mgmt_addr, fabric_nwwn, fabric_pwwn, transceiver_type, transceiver_sn, transceiver_length ]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows, autofit=autofit, font_size=8)
def __init__(self, order_id, parent, local_disk_config_policy, centered=False): mode = local_disk_config_policy.mode if mode == "raid-striped": mode += " (RAID 0)" elif mode == "raid-mirrored": mode += " (RAID 1)" elif mode == "raid-striped-parity": mode += " (RAID 5)" elif mode == "raid-striped-dual-parity": mode += " (RAID 6)" elif mode == "raid-mirrored-striped": mode += " (RAID 10)" elif mode == "raid-striped-parity-striped": mode += " (RAID 50)" elif mode == "raid-striped-dual-parity-striped": mode += " (RAID 60)" rows = [[_("Description"), _("Value")], [_("Name"), local_disk_config_policy.name], [_("Description"), local_disk_config_policy.descr], [_("Organization"), local_disk_config_policy._parent._dn], [_("Mode"), mode], [ _("Protect Configuration"), local_disk_config_policy.protect_configuration ], [ _("FlexFlash State"), local_disk_config_policy.flexflash_state ], [ _("FlexFlash RAID Reporting State"), local_disk_config_policy.flexflash_raid_reporting_state ], [ _("FlexFlash Removable State"), local_disk_config_policy.flexflash_removable_state ]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, vmedia_policy, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), vmedia_policy.name], [_("Description"), vmedia_policy.descr], [_("Organization"), vmedia_policy._parent._dn], [_("Retry on Mount Fail"), vmedia_policy.retry_on_mount_fail]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, inventory, device, centered=False): device_connector = inventory.device_connector[0] rows = [[_("Description"), _("Value")], [_("Claim Status"), device_connector.ownership], [_("Intersight URL"), device_connector.intersight_url], [_("Account Name"), device_connector.ownership_name], [_("Claimed By"), device_connector.ownership_user], [_("Device ID"), device_connector.device_id], [_("Device Connector Version"), device_connector.version]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[0]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, graphics_card_policy, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), graphics_card_policy.name], [_("Description"), graphics_card_policy.descr], [_("Organization"), graphics_card_policy._parent._dn], [ _("Graphics Card Mode"), graphics_card_policy.graphics_card_mode ]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, scrub_policy, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), scrub_policy.name], [_("Description"), scrub_policy.descr], [_("Organization"), scrub_policy._parent._dn], [_("Disk Scrub"), scrub_policy.disk_scrub], [_("FlexFlash Scrub"), scrub_policy.flexflash_scrub], [_("BIOS Settings Scrub"), scrub_policy.bios_settings_scrub], [ _("Persistent Memory Scrub"), scrub_policy.persistent_memory_scrub ]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, boot_policy, centered=False): rows = [[_("Description"), _("Value")], [_("Name"), boot_policy.name], [_("Description"), boot_policy.descr], [_("Organization"), boot_policy._parent._dn], [ _("Reboot on Boot Order Change"), boot_policy.reboot_on_boot_order_change ], [ _("Enforce vNIC/vHBA/iSCSI Name"), boot_policy.enforce_vnic_name ], [_("Boot Mode"), boot_policy.boot_mode], [_("Boot Security"), boot_policy.boot_security]] UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, config, device, centered=False): communication_services = config.communication_services[0] rows = [[_("Service"), _("State")], [_("HTTP"), communication_services.http_service[0]["state"]], [ _("Redirect to HTTPS"), communication_services.http_service[0]["redirect_to_https"] ], [_("HTTPS"), communication_services.https_service[0]["state"]], [_("SNMP"), communication_services.snmp_service[0]["state"]], [_("CIMC"), communication_services.cimc_web_service], [_("SSH"), communication_services.ssh_service], [_("Telnet"), communication_services.telnet_service]] # Cluster info UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[0]), centered=centered, cells_list=rows, autofit=True)
def __init__(self, order_id, parent, fis, fexs, rack_enclosure, centered=False, autofit=True): rows = [[ _("Fabric"), _("Fabric Port"), _("FEX ID"), _("FEX Fabric Port"), _("FEX Host Port"), _("Server ID"), _("Server Node Slot"), _("Adaptor ID"), _("Adaptor Port"), _("Transceiver SKU/Type"), _("Transceiver S/N"), _("Transceiver Length") ]] for fi in fis: for port in fi.ports: if hasattr(port, 'peer'): if port.peer: fi_id = fi.id if port.aggr_port_id: fi_port = port.slot_id + "/" + port.aggr_port_id + "/" + port.port_id else: fi_port = port.slot_id + "/" + port.port_id if "rack" in port.peer.keys(): for server_node in rack_enclosure.server_nodes: if str(port.peer['rack']) == server_node.id: adaptor = port.peer['slot'] adaptor_port = port.peer['port'] if len(port.transceivers) == 1: if port.transceivers[0].sku: transceiver_type = port.transceivers[ 0].sku else: transceiver_type = port.transceivers[ 0].type transceiver_sn = port.transceivers[ 0].serial transceiver_length = port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, "", "", "", server_node.id, server_node.slot_id, adaptor, adaptor_port, transceiver_type, transceiver_sn, transceiver_length ]) if "fex" in port.peer.keys(): for fex in fexs: # We need to find the FEX and the associated peer port if fex.id == str(port.peer['fex']): fex_fabric_port = str( port.peer['slot']) + "/" + str( port.peer['port']) for fex_host_port in fex.host_ports: if fex_host_port.peer: if "rack" in fex_host_port.peer.keys( ): for server_node in rack_enclosure.server_nodes: if str(fex_host_port. peer['rack'] ) == server_node.id: fex_id = fex.id if fex_host_port.aggr_port_id: fex_port = fex_host_port.slot_id + "/" + \ fex_host_port.aggr_port_id + "/" + \ fex_host_port.port_id else: fex_port = fex_host_port.slot_id + "/" + \ fex_host_port.port_id adaptor = fex_host_port.peer[ 'slot'] adaptor_port = fex_host_port.peer[ 'port'] if len(fex_host_port. transceivers ) == 1: if fex_host_port.transceivers[ 0].sku: transceiver_type = fex_host_port.transceivers[ 0].sku else: transceiver_type = fex_host_port.transceivers[ 0].type transceiver_sn = fex_host_port.transceivers[ 0].serial transceiver_length = fex_host_port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, fex_id, fex_fabric_port, fex_port, server_node.id, server_node. slot_id, adaptor, adaptor_port, transceiver_type, transceiver_sn, transceiver_length ]) # In case all racks are not connected, this prevents an IndexError exception if len(rows) == 1: column_number = 0 else: column_number = len(rows[1]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=column_number, centered=centered, cells_list=rows, autofit=autofit)
def __init__(self, order_id, parent, boot_policy, centered=False): rows = [[ _("Order"), _("Device Type"), _("vNIC/vHBA Name"), _("vNIC/vHBA Type"), _("IP Address Type"), _("LUN"), _("Target WWPN"), _("Type"), _("Slot Number"), _("Boot Loader Name"), _("Boot Loader Path"), _("Boot Loader Description") ]] for boot_item in sorted(boot_policy.boot_order, key=lambda x: x["order"], reverse=False): if "vnic" in boot_item: if boot_item["vnics"]: for vnic in boot_item["vnics"]: rows.append([ boot_item["order"], boot_item["device_type"], vnic["name"], vnic["type"], vnic["ip_address_type"], None, None, None, None, None, None, None ]) continue if "iscsi_vnics" in boot_item: if boot_item["iscsi_vnics"]: for iscsi_vnic in boot_item["iscsi_vnics"]: rows.append([ boot_item["order"], boot_item["device_type"], iscsi_vnic["name"], iscsi_vnic["type"], None, None, None, None, None, iscsi_vnic["boot_loader_name"], iscsi_vnic["boot_loader_path"], iscsi_vnic["boot_loader_description"] ]) continue if "vhbas" in boot_item: if boot_item["vhbas"]: for vhba in boot_item["vhbas"]: if "targets" in vhba: if vhba["targets"]: for target in vhba["targets"]: rows.append([ boot_item["order"], boot_item["device_type"], vhba["name"], vhba["type"], None, target["lun"], target["wwpn"], target["type"], None, target["boot_loader_name"], target["boot_loader_path"], target["boot_loader_description"] ]) continue if "embedded_local_disks" in boot_item: if boot_item["embedded_local_disks"]: for embedded_local_disk in boot_item[ "embedded_local_disks"]: rows.append([ boot_item["order"], boot_item["device_type"], None, None, None, None, None, embedded_local_disk["type"], embedded_local_disk["slot_number"], embedded_local_disk["boot_loader_name"], embedded_local_disk["boot_loader_path"], embedded_local_disk["boot_loader_description"] ]) continue if "local_luns" in boot_item: if boot_item["local_luns"]: for local_lun in boot_item["local_luns"]: rows.append([ boot_item["order"], boot_item["device_type"], None, None, None, local_lun["name"], None, local_lun["type"], None, local_lun["boot_loader_name"], local_lun["boot_loader_path"], local_lun["boot_loader_description"] ]) continue if "local_jbods" in boot_item: if boot_item["local_jbods"]: for local_jbod in boot_item["local_jbods"]: rows.append([ boot_item["order"], boot_item["device_type"], None, None, None, None, None, None, local_jbod["slot_number"], None, None, None ]) continue if "embedded_local_luns" in boot_item: if boot_item["embedded_local_luns"]: for embedded_local_lun in boot_item["embedded_local_luns"]: rows.append([ boot_item["order"], boot_item["device_type"], None, None, None, None, None, None, None, embedded_local_lun["boot_loader_name"], embedded_local_lun["boot_loader_path"], embedded_local_lun["boot_loader_description"] ]) continue rows.append([ boot_item["order"], boot_item["device_type"], None, None, None, None, None, None, None, None, None, None ]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows, font_size=8)
def __init__(self, order_id, parent, fis, centered=False, autofit=True): rows = [[ _("Fabric"), _("Fabric Port"), _("Remote Name"), _("Remote Interface"), _("Remote Model"), _("Remote S/N"), _("Transceiver SKU/Type"), _("Transceiver S/N"), _("Transceiver Length") ]] for fi in fis: for port in fi.ports: if port.type == "lan": if hasattr(port, 'neighbor_entries'): if port.neighbor_entries: for neighbor_entry in port.neighbor_entries: fi_id = fi.id if port.aggr_port_id: fi_port = port.slot_id + "/" + port.aggr_port_id + "/" + port.port_id else: fi_port = port.slot_id + "/" + port.port_id remote_name = "" if hasattr(neighbor_entry, "lldp_system_name"): if neighbor_entry.lldp_system_name: remote_name = neighbor_entry.lldp_system_name if hasattr( neighbor_entry, "cdp_system_name") and not remote_name: if neighbor_entry.cdp_system_name: remote_name = neighbor_entry.cdp_system_name remote_interface = "" if hasattr(neighbor_entry, "cdp_remote_interface"): if neighbor_entry.cdp_remote_interface: remote_interface = neighbor_entry.cdp_remote_interface if hasattr(neighbor_entry, "lldp_remote_interface" ) and not remote_interface: if neighbor_entry.lldp_remote_interface: remote_interface = neighbor_entry.lldp_remote_interface remote_device_model = neighbor_entry.model remote_sn = neighbor_entry.serial if len(port.transceivers) == 1: if port.transceivers[0].sku: transceiver_type = port.transceivers[ 0].sku else: transceiver_type = port.transceivers[ 0].type transceiver_sn = port.transceivers[ 0].serial transceiver_length = port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, remote_name, remote_interface, remote_device_model, remote_sn, transceiver_type, transceiver_sn, transceiver_length ]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows, autofit=autofit, font_size=8)
def __init__(self, order_id, parent, config, device, centered=False): config_system = config.system[0] config_mng_int = config.management_interfaces[0] rows = [[_("Description"), _("Value")], [_("System Name"), config_system.name], [_("Version"), config.device_version], [_("Cluster IP Address"), config_system.virtual_ip], [_("Netmask"), config_mng_int.netmask], [_("Gateway"), config_mng_int.gateway]] # Cluster info if config_system.virtual_ipv6 and config_system.virtual_ipv6 not in [ "::" ]: rows.append( [_("Cluster IP V6 Address"), config_system.virtual_ipv6]) if config_mng_int.gateway_v6 and config_mng_int.gateway_v6 not in [ "::" ]: rows.append([_("Gateway V6"), config_mng_int.gateway_v6]) # FI A (& B) info if config.management_interfaces: for interface in config.management_interfaces: if interface.fabric == "A": if interface.ipv6 not in ["", "::"]: rows.append([_("FI A - IPv6 Address"), interface.ipv6]) rows.append([_("FI A - IP Address"), interface.ip]) if interface.fabric == "B": if interface.ipv6 not in ["", "::"]: rows.append([_("FI B - IPv6 Address"), interface.ipv6]) rows.append([_("FI B - IP Address"), interface.ip]) # General cluster info if config_system.descr: rows.append([_("Description"), config_system.descr]) if config_system.site: rows.append([_("Site"), config_system.site]) if config_system.owner: rows.append([_("Owner"), config_system.owner]) if config_system.domain_name: rows.append([_("Domain Name"), config_system.domain_name]) # Timezone and DNS info if config.timezone_mgmt: if config.timezone_mgmt[0].zone: rows.append([_("Time Zone"), config.timezone_mgmt[0].zone]) if config.timezone_mgmt[0].ntp: rows.append([ _("NTP"), str(config.timezone_mgmt[0].ntp).replace("'", "").replace( "[", "").replace("]", "") ]) if config.dns: rows.append([ _("DNS"), str(config.dns).replace("'", "").replace("[", "").replace("]", "") ]) if config.call_home: rows.append([_("Call Home"), config.call_home[0].admin_state]) if config.ucs_central: rows.append([ _("Link to UCS Central"), _("Registered to ") + config.ucs_central[0].ip_address ]) else: rows.append([_("Link to UCS Central"), "off"]) rows.append([_("Intersight Claim Status"), config.intersight_status]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[0]), centered=centered, cells_list=rows)
def __init__(self, order_id, parent, fis, fexs, chassis, centered=False, autofit=True): ext_port_type = "SIOC" if chassis.model in [ "UCSC-C3X60", "UCSS-S3260" ] else "IOM" rows = [[ _("Fabric"), _("Fabric Port"), _("FEX ID"), _("FEX Fabric Port"), _("FEX Host Port"), ext_port_type, ext_port_type + _(" Port"), _("Transceiver SKU/Type"), _("Transceiver S/N"), _("Transceiver Length") ]] for fi in fis: for port in fi.ports: if hasattr(port, 'peer'): if port.peer: fi_id = fi.id if port.aggr_port_id: fi_port = port.slot_id + "/" + port.aggr_port_id + "/" + port.port_id else: fi_port = port.slot_id + "/" + port.port_id if "chassis" in port.peer.keys(): if str(port.peer['chassis']) == chassis.id: iom = port.peer['slot'] iom_port = port.peer['port'] if len(port.transceivers) == 1: if port.transceivers[0].sku: transceiver_type = port.transceivers[ 0].sku else: transceiver_type = port.transceivers[ 0].type transceiver_sn = port.transceivers[ 0].serial transceiver_length = port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, "", "", "", iom, iom_port, transceiver_type, transceiver_sn, transceiver_length ]) if "fex" in port.peer.keys(): for fex in fexs: # We need to find the FEX and the associated peer port if fex.id == str(port.peer['fex']): fex_fabric_port = str( port.peer['slot']) + "/" + str( port.peer['port']) for fex_host_port in fex.host_ports: if fex_host_port.peer: if "chassis" in fex_host_port.peer.keys( ): if str(fex_host_port.peer[ 'rack']) == chassis.id: fex_id = fex.id if fex_host_port.aggr_port_id: fex_port = fex_host_port.slot_id + "/" + \ fex_host_port.aggr_port_id + "/" + \ fex_host_port.port_id else: fex_port = fex_host_port.slot_id + "/" + fex_host_port.port_id adaptor = fex_host_port.peer[ 'slot'] adaptor_port = fex_host_port.peer[ 'port'] if len(fex_host_port. transceivers) == 1: if fex_host_port.transceivers[ 0].sku: transceiver_type = fex_host_port.transceivers[ 0].sku else: transceiver_type = fex_host_port.transceivers[ 0].type transceiver_sn = fex_host_port.transceivers[ 0].serial transceiver_length = fex_host_port.transceivers[ 0].length else: transceiver_type = "" transceiver_sn = "" transceiver_length = "" rows.append([ fi_id, fi_port, fex_id, fex_fabric_port, fex_port, adaptor, adaptor_port, transceiver_type, transceiver_sn, transceiver_length ]) UcsReportTable.__init__(self, order_id=order_id, parent=parent, row_number=len(rows), column_number=len(rows[1]), centered=centered, cells_list=rows, autofit=autofit)