def osh_createEviewOsh(localshell, zOsOsh, appPath, confFolder, file, nodeName, eviewVersion, defaultIp): # Create EView agent OSH --------------------------------------------------- logger.debug('Creating EView object') eviewOSH = ObjectStateHolder('eview') if _CMDB_CLASS_MODEL.version() >= 9: eviewOSH.setAttribute('name', nodeName) eviewOSH.setAttribute('discovered_product_name', nodeName) eviewOSH.setAttribute('version', eviewVersion) else: eviewOSH.setAttribute('data_name', nodeName) eviewOSH.setAttribute('application_version', eviewVersion) eviewOSH.setAttribute('application_path', appPath) eviewOSH.setAttribute('application_ip', defaultIp) eviewOSH.setAttribute('vendor', 'EView Technology Inc.') eviewOSH.setAttribute('eview_agent_type', 'z/OS') fileContents = localshell.safecat('%s%s' % (confFolder, file)) address, port = eview_lib.getEviewAgentAddress(localshell, fileContents) if eview_lib.isNotNull(address): eviewOSH.setAttribute('application_ip', address) if eview_lib.isNotNull(port) and eview_lib.isnumeric(port): eviewOSH.setIntegerAttribute('application_port', int(port)) eviewOSH.setContainer(zOsOsh) return eviewOSH
def osh_createIpOsh(zOsOsh, defaultIp): _vector = ObjectStateHolderVector() # Create IP OSH ------------------------------------ if eview_netutils._isValidIp(defaultIp): ipOsh = eview_netutils._buildIp(defaultIp) _vector.add(ipOsh) _vector.add(zOsOsh) if _CMDB_CLASS_MODEL.version() < 9: linkOsh = modeling.createLinkOSH('contained', zOsOsh, ipOsh) _vector.add(linkOsh) else: linkOsh = modeling.createLinkOSH('containment', zOsOsh, ipOsh) _vector.add(linkOsh) return _vector
def osh_createZOsOsh(defaultIp, zOsRelease, ieasymList, ieasysList, machineBootDate, symbolsMap, memory, cpcSi): # Create LPAR OSH ---------------------------------- # version 9.0+ attributes -------------------------------------------------- str_discovered_os_name = 'discovered_os_name' str_discovered_os_version = 'discovered_os_version' str_vendor = 'vendor' str_os_vendor = 'os_vendor' str_name = 'name' str_serial_number = 'serial_number' # version 8.0- attributes -------------------------------------------------- if _CMDB_CLASS_MODEL.version() < 9: str_discovered_os_name = 'host_os' str_discovered_os_version = 'host_osversion' str_vendor = 'host_vendor' str_os_vendor = 'host_vendor' # duplicated str_name = 'data_name' str_serial_number = 'host_serialnumber' isComplete = 1 zOsOsh = modeling.createHostOSH(defaultIp, 'zos', _STR_EMPTY, _STR_EMPTY, machineBootDate) zOsOsh.setAttribute(str_discovered_os_name, 'z/OS') zOsOsh.setBoolAttribute('host_iscomplete', isComplete) zOsOsh.setAttribute(str_discovered_os_version, zOsRelease) zOsOsh.setAttribute(str_os_vendor, 'IBM') zOsOsh.setAttribute(str_vendor, 'IBM') zOsOsh.setAttribute('ieasym_list', ieasymList) # Spencer: Set memory attribute zOsOsh.setAttribute('memory_size', memory) if isNotNull(cpcSi): cpcSiList = string.split(cpcSi, '.') if len(cpcSiList) == 5: cpcSerial = cpcSiList[4] zOsOsh.setAttribute(str_serial_number,cpcSerial ) if isNotNull(symbolsMap) and len(symbolsMap) > 0: if symbolsMap.has_key('SYSNAME'): zOsOsh.setAttribute(str_name, symbolsMap['SYSNAME']) if symbolsMap.has_key('SYSALVL'): zOsOsh.setAttribute('mvs_architecture_level', symbolsMap['SYSALVL']) if symbolsMap.has_key('SYSCLONE'): zOsOsh.setAttribute('mvs_system_clone', symbolsMap['SYSCLONE']) if symbolsMap.has_key('SYSALVL'): zOsOsh.setAttribute('mvs_system_r1', symbolsMap['SYSR1']) return zOsOsh