• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python modeling.createHostOSH函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中modeling.createHostOSH函数的典型用法代码示例。如果您正苦于以下问题:Python createHostOSH函数的具体用法?Python createHostOSH怎么用?Python createHostOSH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了createHostOSH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _build_fc_switch_osh

def _build_fc_switch_osh(switch):
    '@types: Switch -> osh'
    ipAddress = switch.address
    if ipAddress and ip_addr.isValidIpAddress(ipAddress):
        fcSwitchOSH = modeling.createHostOSH(str(ipAddress), 'fcswitch')
    else:
        logger.debug('IP address not available for Switch <%s> with ID <%s>!! Creating Switch with ID as primary key...' % (switch.name, switch.id))
        hostKey = switch.id + ' (ECC ID)'
        fcSwitchOSH = modeling.createCompleteHostOSH('fcswitch', hostKey)
        fcSwitchOSH.setAttribute('data_note', 'IP address unavailable in ECC - Duplication of this CI is possible')

    used_ports = None
    if switch.portcount != None and switch.portcount_free != None:
        used_ports = switch.portcount - switch.portcount_free

    populateOSH(fcSwitchOSH, {
        'data_description': switch.sn,
        'fcswitch_wwn': switch.sn,
        'data_name': switch.name,
        'host_model': switch.host_model,
        'fcswitch_version': switch.version,
        'host_vendor': switch.host_vendor,
        'fcswitch_domainid': switch.domain_id,
        'fcswitch_availableports': switch.portcount,
        'fcswitch_freeports': switch.portcount_free,
        'fcswitch_connectedports': used_ports
    })
    fcSwitchOSH.setListAttribute('node_role', ['switch'])
    return fcSwitchOSH
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:29,代码来源:ECC_Discovery.py


示例2: DiscoveryMain

def DiscoveryMain(Framework):
    OSHVResult = ObjectStateHolderVector()

    ip_address = Framework.getDestinationAttribute('ip_address')
    
    hostOSH = modeling.createHostOSH(ip_address)
    
    protocols = Framework.getAvailableProtocols(ip_address, ClientsConsts.SQL_PROTOCOL_NAME)
    
    for sqlProtocol in protocols:
        dbClient = None
        try:
            try:
                if dbutils.protocolMatch(Framework, sqlProtocol, 'sybase', None, None) == 0:
                    continue

                dbClient = Framework.createClient(sqlProtocol)
                logger.debug('Connnected to sybase on ip ', dbClient.getIpAddress(), ', port ', str(dbClient.getPort()), ' to database ',dbClient.getDatabaseName(),'with user ', dbClient.getUserName())
                dbversion = dbClient.getDbVersion()
                
                logger.debug('Found sybase server of version:', dbversion)
                res = dbClient.executeQuery("select srvnetname from master..sysservers where srvid = 0")#@@CMD_PERMISION sql protocol execution
                if res.next():
                    dbname=string.strip(res.getString(1))
                    sybasedOSH = modeling.createDatabaseOSH('sybase', dbname, str(dbClient.getPort()),dbClient.getIpAddress(),hostOSH,sqlProtocol,dbClient.getUserName(),None,dbversion)
                    OSHVResult.add(sybasedOSH)
                else:
                    Framework.reportWarning('Sybase server was not found')
            except MissingJarsException, e:
                logger.debugException(e.getMessage())
                Framework.reportError(e.getMessage())
                return
            except:
                logger.debugException('Failed to discover sybase with credentials ', sqlProtocol)
        finally:
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:35,代码来源:sybase_net_dis.py


示例3: build

 def build(self):
     if self.ipAddress and self.queueName:
         self.hostOsh = modeling.createHostOSH(self.ipAddress)
         self.msMqManagerOsh = modeling.createApplicationOSH('msmqmanager', 'Microsoft MQ Manager', self.hostOsh)
         self.queueOsh = ObjectStateHolder('msmqqueue')
         self.queueOsh.setAttribute('data_name', self.queueName.lower())
         self.queueOsh.setContainer(self.msMqManagerOsh)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:ntcmd_msmq.py


示例4: createIPEndpointOSHV

def createIPEndpointOSHV(framework, ipAddress, portNum, portName, hostname = None, protocol = modeling.SERVICEADDRESS_TYPE_TCP):
    OSHVResult = ObjectStateHolderVector()
    if ip_addr.isValidIpAddress(hostname):
        hostname = None
    
    fqdn, aliasList = getHostNames(ipAddress, framework)
    
    hostOSH = modeling.createHostOSH(ipAddress, 'node', None, fqdn)
    ipOSH = modeling.createIpOSH(ipAddress, None, fqdn)
    link = modeling.createLinkOSH('containment', hostOSH, ipOSH)
    
    OSHVResult.add(hostOSH)
    OSHVResult.add(ipOSH)
    OSHVResult.add(link)
    
    ipPort = modeling.createServiceAddressOsh(hostOSH, ipAddress, portNum, protocol, portName)
    if fqdn:
        ipPort.setStringAttribute('ipserver_address', fqdn)
    
    if isValidFQDN(hostname):         
        ipPort.setStringAttribute('ipserver_address', hostname)
    
    #ipPort.addAttributeToList('itrc_alias', sv)
    #ipOSH.addAttributeToList('itrc_alias', sv)        
         
    #OSHVResult.add(modeling.createLinkOSH('usage', ipPort, ipOSH)) 
    OSHVResult.add(ipPort)
   
    return hostOSH, ipOSH, OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:29,代码来源:pi_utils.py


示例5: reportRemotePeer

def reportRemotePeer(remote_peer, localInterfaceOsh, local_mac):
    vector = ObjectStateHolderVector()
    if remote_peer.peer_ips:
        hostOsh = modeling.createHostOSH(str(remote_peer.peer_ips[0]))
    if remote_peer.platform in VIRTUAL_HOST_PLATFORMS:
        hostOsh.setBoolAttribute('host_isvirtual', 1)
        vector.add(hostOsh)
        for ip in remote_peer.peer_ips:
            ipOsh = modeling.createIpOSH(ip)
            linkOsh = modeling.createLinkOSH('containment', hostOsh, ipOsh)
            vector.add(ipOsh)
            vector.add(linkOsh)
    else:
        hostOsh = ObjectStateHolder('node')
        hostOsh.setBoolAttribute('host_iscomplete', 1)
        hostOsh.setStringAttribute('name', remote_peer.system_name)
        if remote_peer.platform in VIRTUAL_HOST_PLATFORMS:
            hostOsh.setBoolAttribute('host_isvirtual', 1)
        vector.add(hostOsh)
    
    if remote_peer.interface_name or remote_peer.interface_mac:
        remoteInterfaceOsh = modeling.createInterfaceOSH(mac = remote_peer.interface_mac, hostOSH = hostOsh, name = remote_peer.interface_name)
        if not remoteInterfaceOsh:
            return ObjectStateHolderVector()
        if remote_peer.interface_name:
            remoteInterfaceOsh.setStringAttribute('name', remote_peer.interface_name)
        vector.add(remoteInterfaceOsh)
        l2id = str(hash(':'.join([remote_peer.interface_mac or remote_peer.interface_name, local_mac])))
        vector.addAll(reportLayer2Connection(localInterfaceOsh, remoteInterfaceOsh, l2id))
    return vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:30,代码来源:layer2.py


示例6: buildDBObjects

def buildDBObjects(db_type, host_ip, db_port, db_name, db_sid, appServerOSH, OSHVResult):
	logger.debug('building TNS Entry ', db_type, host_ip, db_name, db_port, db_sid)

	oshs = []
	hostOSH = modeling.createHostOSH(host_ip)
	oshs.append(hostOSH)
	dbOSH, ipseOsh, databaseOshs = None, None, None

	platform = db_platform.findPlatformBySignature(db_type)
	if not platform:
		logger.warn("Failed to determine platform for %s" % db_type)
	else:
		dbserver = db_builder.buildDatabaseServerPdo(db_type, db_name, host_ip, db_port)
		if not db_name and not db_port:
			builder = db_builder.Generic()
		else:
			builder = db_builder.getBuilderByPlatform(platform)

		dbTopologyReporter = db.TopologyReporter(builder)
		result = dbTopologyReporter.reportServerWithDatabases(dbserver,
															  hostOSH,
															  (appServerOSH,))
		dbOSH, ipseOsh, databaseOshs, vector_ = result
		oshs.extend(vector_)

	OSHVResult.addAll(oshs)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:26,代码来源:siebel_discover_odbc.py


示例7: modelConnectedPortByPowerShell

def modelConnectedPortByPowerShell(context):
    endpointOSHV = ObjectStateHolderVector()
    try:
        logger.debug("reporting endpoints for iis using powershell")
        shell = NTCMD_IIS.CscriptShell(context.client)
        system32Location = shell.createSystem32Link() or '%SystemRoot%\\system32'
        discoverer = iis_powershell_discoverer.get_discoverer(shell)
        if isinstance(discoverer, iis_powershell_discoverer.PowerShellOverNTCMDDiscoverer):
            discoverer.system32_location = system32Location
        executor = discoverer.get_executor(shell)
        sites_info = iis_powershell_discoverer.WebSitesCmd() | executor
        for site_info in sites_info:
            site_name = site_info.get("name")
            if site_name:
                bindings = iis_powershell_discoverer.WebSiteBindingCmd(site_name) | executor
                host_ips = []
                host_ips.append(context.application.getApplicationIp())
                logger.debug("application ip", context.application.getApplicationIp())
                parse_func = partial(iis_powershell_discoverer.parse_bindings, host_ips=host_ips)
                bindings = map(parse_func, bindings)
                for binding in bindings:
                    logger.debug("reporting binding:", binding[2])
                    for bind in binding[2]:
                        endpointOSH = visitEndpoint(bind)
                        hostosh = context.application.getHostOsh()
                        ip = bind.getAddress()
                        hostosh = modeling.createHostOSH(ip)
                        endpointOSH.setContainer(hostosh)
                        linkOsh = modeling.createLinkOSH("usage", context.application.getOsh(), endpointOSH)
                        endpointOSHV.add(endpointOSH)
                        endpointOSHV.add(linkOsh)

    except Exception, ex:
        logger.debug("Cannot get port from powershell:", ex)
        return None
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:35,代码来源:plugins_microsoft_iis_version.py


示例8: getTopology

    def getTopology(self, ipAddress):
        lb = modeling.createHostOSH(ipAddress, 'host')
        cisco_ace = modeling.createApplicationOSH('cisco_ace', 'Cisco_ACE', lb, 'Load Balance', 'Cisco')
        self.OSHVResult.add(lb)
        self.OSHVResult.add(cisco_ace)

        self.discoverVirtualServers(cisco_ace)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:Cisco_ACE_by_SNMP.py


示例9: discoverContentRules

	def discoverContentRules(self):
		contentRuleQueryBuilder = SnmpQueryBuilder(CNT_OID_OFFSET)
		contentRuleQueryBuilder.addQueryElement(2, 'cnt_name')
		contentRuleQueryBuilder.addQueryElement(4, 'ipserver_address')
		contentRuleQueryBuilder.addQueryElement(5, 'ipport_type')
		contentRuleQueryBuilder.addQueryElement(6, 'ipport_number')
		contentRuleQueryBuilder.addQueryElement(68, 'ip_range')
		snmpRowElements = self.snmpAgent.getSnmpData(contentRuleQueryBuilder)
		
		for snmpRowElement in snmpRowElements:
			virtualServer = modeling.createHostOSH(snmpRowElement.ipserver_address, 'clusteredservice')
			virtualServerHostKey = virtualServer.getAttributeValue('host_key')
			virtualServer.setAttribute('data_name', virtualServerHostKey)
			self.OSHVResult.add(modeling.createLinkOSH('owner', self.css, virtualServer))
			self.OSHVResult.add(virtualServer)			
			
			resourcePool = ObjectStateHolder('loadbalancecluster')
			resourcePool.setStringAttribute('data_name', snmpRowElement.cnt_name)
			self.OSHVResult.add(modeling.createLinkOSH('contained', resourcePool, virtualServer))
			self.OSHVResult.add(resourcePool)
			self.resourcePools[snmpRowElement.cnt_name] = resourcePool
			
			serviceAddress = modeling.createServiceAddressOsh(virtualServer,
											snmpRowElement.ipserver_address,
											snmpRowElement.ipport_number,
											CNT_PROTOCOL_MAP[snmpRowElement.ipport_type])
			serviceAddress.setContainer(virtualServer)
			self.OSHVResult.add(serviceAddress)

			# KB specific: fix of port translations
			self.resourcePoolsToServiceAddress[snmpRowElement.cnt_name] = serviceAddress

			for i in range(int(snmpRowElement.ip_range)):
				#TODO: Add all IPs from range
				pass
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:35,代码来源:Cisco_CSS_by_SNMP.py


示例10: process

    def process(self, context):
        '''
        Plugin gets system information from DEFAULT profile. In case if profile
        cannot be processed - system information is parsed from instance
        profile path.

        Default profile read for system (identified by its path) is shared
        between application component instances
        '''
        shell = context.client
        osh = context.application.applicationOsh
        host_osh = context.hostOsh
        attrName = sap.InstanceBuilder.INSTANCE_PROFILE_PATH_ATTR
        pf_path = osh.getAttributeValue(attrName)
        logger.info("Instance pf path is: %s" % pf_path)
        system, pf_name = sap_discoverer.parsePfDetailsFromPath(pf_path)
        logger.info("Parsed details from pf name: %s" % str((system, pf_name)))
        topology = self._discover_topology(shell, system, pf_path)
        if topology:
            #resolver = dns_resolver.SocketDnsResolver()
            resolver = dns_resolver.create(shell, local_shell=None,
                                   dns_server=None,
                                   hosts_filename=None)

            db_host_osh, oshs = _report_db_host(topology, resolver)
            application_ip = _report_application_ip(shell, topology, resolver)
            if application_ip:
                logger.info("application ip is: %s" % application_ip)
                osh.setAttribute('application_ip', str(application_ip))
                host_app_osh = modeling.createHostOSH(str(application_ip))
                logger.info("set container: %s" % host_app_osh)
                osh.setContainer(host_app_osh)
            oshs.extend(self._report_topology(osh, host_osh, db_host_osh, topology))
            context.resultsVector.addAll(oshs)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:34,代码来源:plugins_sap_instance_topology.py


示例11: executeWmiQuery

def executeWmiQuery(client, OSHVResult, nodeOsh=None):
    '''
    @deprecated: Use NTCMD_HR_Dis_Disk_Lib.discoverDiskByWmic instead
    '''
    containerOsh = nodeOsh or modeling.createHostOSH(client.getIpAddress())
    NTCMD_HR_Dis_Disk_Lib.discoverDiskByWmic(client, OSHVResult, containerOsh)
    NTCMD_HR_Dis_Disk_Lib.discoverPhysicalDiskByWmi(client, OSHVResult, containerOsh)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:wmi_dis_disk_lib.py


示例12: build_network_device

def build_network_device(device):
    '''
    Build Layer 2 connection end.
    @type param: NetworkDevice -> OSH
    '''
    device_osh = None
    device_ip_address_osh = None
    device_interface_osh = None
    device_member_ip = None
    if device.ucmdb_id:
        device_osh = modeling.createOshByCmdbIdString('node', device.ucmdb_id)
    if device.mac_address:
        if not device_osh:
            device_osh = modeling.createCompleteHostOSH('node', device.mac_address)
        device_interface_osh = modeling.createInterfaceOSH(device.mac_address, device_osh)
    if device.ip_address:
        if not device_osh:
            device_osh = modeling.createHostOSH(device.ip_address)
        device_ip_address_osh = modeling.createIpOSH(device.ip_address)
        device_member_ip = modeling.createLinkOSH('contained', device_osh, device_ip_address_osh)
    if device.port:
        if device_interface_osh:
            device_interface_osh.setAttribute('interface_name', device.port)
        elif device_osh:
            device_interface_osh = ObjectStateHolder('interface')
            device_interface_osh.setContainer(device_osh)
            device_interface_osh.setAttribute('interface_name', device.port)
    return device_osh, device_ip_address_osh, device_interface_osh, device_member_ip
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:28,代码来源:SNMP_CDP_LLDP.py


示例13: doDiscovery

def doDiscovery(Framework, shell, ip, credentialId, codepage, shellName, warningsList, errorsList, uduid = None):
    vector = ObjectStateHolderVector()
    try:
        try:
            languageName = shell.osLanguage.bundlePostfix

            langBund = Framework.getEnvironmentInformation().getBundle('langNetwork', languageName)
                             
            remoteHostnames = dns_resolver.NsLookupDnsResolver(shell).resolve_hostnames(ip)
            remoteHostFqdn = None 
            if remoteHostnames:
                remoteHostFqdn = remoteHostnames[0]
            shellObj = createShellObj(shell, ip, langBund, languageName, codepage, remoteHostFqdn)
            try:
                vector.addAll(discover(shell, shellObj, ip, langBund, Framework, uduid))
            finally:
                # create shell OSH if connection established
                if shellObj and not vector.size():
                    hostOsh = modeling.createHostOSH(ip)
                    shellObj.setContainer(hostOsh)
                    vector.add(shellObj)
        except Exception, ex:
            strException = ex.getMessage()
            errormessages.resolveAndAddToObjectsCollections(strException, shellName, warningsList, errorsList)
        except:
            msg = str(sys.exc_info()[1])
            logger.debugException('')
            errormessages.resolveAndAddToObjectsCollections(msg, shellName, warningsList, errorsList)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:28,代码来源:Host_Connection_by_powershell.py


示例14: osh_createiSeriesOsh

def osh_createiSeriesOsh(defaultIp,  model, osversion, serialnbr,sysname, macAddress):

    # Create Iseries OSH ----------------------------------
    str_discovered_os_name = 'discovered_os_name'
    str_discovered_os_version = 'discovered_os_version'
    str_discovered_os_vendor = 'discovered_os_vendor'
    str_discovered_model = 'discovered_model'
    str_vendor = 'vendor'
    str_os_vendor = 'os_vendor'
    str_name = 'name'
    host_key = 'host_key'
    str_serialnbr = 'serial_number'
    
    isComplete = 1    
    os400Osh = modeling.createHostOSH(defaultIp, 'as400_node', _STR_EMPTY, _STR_EMPTY, _STR_EMPTY)
    os400Osh.setAttribute(str_discovered_os_name, 'os/400')
    os400Osh.setBoolAttribute('host_iscomplete', isComplete)
    os400Osh.setAttribute(str_discovered_os_version, osversion)
    os400Osh.setAttribute(str_discovered_model, model)
    os400Osh.setAttribute(str_os_vendor, 'IBM')
    os400Osh.setAttribute(str_discovered_os_vendor, 'IBM')
    os400Osh.setAttribute(str_vendor, 'IBM')
    os400Osh.setAttribute(str_name, sysname )
    os400Osh.setAttribute(str_serialnbr, serialnbr )     
    os400Osh.setAttribute(host_key, macAddress )   
    
    return os400Osh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:27,代码来源:eview400_connection.py


示例15: reporterMSCluster

    def reporterMSCluster(self, vector, ms_cluster, groups, ipDictByGroupName, nodesWithIP):
        clusterOsh = ms_cluster.create_osh()
        vector.add(clusterOsh)
        vector.add(modeling.createLinkOSH('membership', clusterOsh, self.applicationOsh))

        for node in nodesWithIP:
            ips = nodesWithIP[node]
            hostOsh = (modeling.createHostOSH(str(ips[0]), 'nt')
                       or ObjectStateHolder('nt'))
            hostOsh.setStringAttribute('name', node)
            hostOsh.setStringAttribute('os_family', 'windows')
            for ip_obj in ips:
                ipOSH = modeling.createIpOSH(ip_obj)
                vector.add(ipOSH)
                vector.add(modeling.createLinkOSH('containment', hostOsh, ipOSH))
            softwareOsh = modeling.createClusterSoftwareOSH(hostOsh,
                                                            'Microsoft Cluster SW', ms_cluster.version)
            softwareOsh.setAttribute("application_version_number", ms_cluster.version)
            vector.add(softwareOsh)
            vector.add(modeling.createLinkOSH('membership', clusterOsh, softwareOsh))

        for group in groups:
            ips = ipDictByGroupName.get(group.name, None)
            if ips:
                for ip in ips:
                    groupOsh = group.create_osh()
                    vector.add(groupOsh)
                    vector.add(modeling.createLinkOSH('contained', clusterOsh, groupOsh))

                    ipOsh = modeling.createIpOSH(ip)
                    vector.add(modeling.createLinkOSH('contained', groupOsh, ipOsh))
                    vector.add(ipOsh)
                    self.__crgMap[str(ip)] = groupOsh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:33,代码来源:plugin_mscluster_ntcmd_version.py


示例16: _createHostOsh

    def _createHostOsh(self):
        ''' method creates containing host OSH depending on settings in XML and discovered data '''

        appComponent = self.getApplicationComponent()

        if appComponent.isClustered():
            # clustered applications should use weak hosts by IP
            hostIp = self._applicationIp

            if hostIp and ip_addr.IPAddress(hostIp).get_is_private():
                hostIp = self.getConnectionIp()

            if not hostIp:
                raise applications.ApplicationSignatureException("Cannot report application since no valid host IP is found")

            logger.debug(" -- clustered application uses host by IP '%s'" % hostIp)

            self.hostOsh = modeling.createHostOSH(hostIp)
        else:
            # non-clustered applications use host by hostId

            self.hostOsh = self.getApplicationComponent().getHostOsh()
            logger.debug(self.hostOsh)

            if self.hostOsh:
                logger.debug(" -- application uses host by Host OSH")
            else:
                logger.debug(" -- application uses host by CMDB ID")
                hostId = self.getApplicationComponent().getHostId()
                if hostId:
                    self.hostOsh = modeling.createOshByCmdbIdString('host', hostId)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:31,代码来源:asm_applications.py


示例17: discoverReplication

    def discoverReplication(self, mysqlOsh):
        """
        Tries to find config variables related to mysql replication 
        @param ObjectStateHolder mysqlOsh mysql osh
        @return list list of OSHs
        """
        masterHostIp = self.getProperty('master-host')
        if not masterHostIp:
            return 
        if not netutils.isValidIp(masterHostIp):
            try:
                resolver = netutils.DnsResolverByShell(self.shell)
                masterHostIp = resolver.resolveIpsByHostname(masterHostIp)[0]
            except netutils.ResolveException:
                logger.warn('Failed to resolve Master Host into IP')
                return
        masterPort = self.getProperty('master-port')
        mysqlReplicationOsh = ObjectStateHolder('mysql_replication')
        mysqlReplicationOsh.setAttribute('data_name', 'MySQL Replication')
        mysqlReplicationOsh.setContainer(mysqlOsh)
        self.setAttribute(mysqlReplicationOsh, 'master_user', self.REPL_ARGS_MAPPING)
        self.setAttribute(mysqlReplicationOsh, 'master_connect_retry', self.REPL_ARGS_MAPPING)
        masterHostOsh = modeling.createHostOSH(masterHostIp)
        serviceAddressOsh = modeling.createServiceAddressOsh(masterHostOsh, masterHostIp, masterPort, modeling.SERVICEADDRESS_TYPE_TCP)
        clientServerLink = modeling.createLinkOSH('client_server', mysqlReplicationOsh, serviceAddressOsh)
        clientServerLink.setStringAttribute('clientserver_protocol', 'TCP')
        clientServerLink.setLongAttribute('clientserver_destport', int(masterPort))
#        masterMysqlOsh = modeling.createDatabaseOSH('mysql', 'MySQL. Port ' + masterPort, masterPort, masterHostIp, masterHostOsh)
#        useLink = modeling.createLinkOSH('use', masterHostOsh, serviceAddressOsh)
        return [masterHostOsh, serviceAddressOsh, clientServerLink, mysqlReplicationOsh]
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:30,代码来源:MySqlDiscoverer.py


示例18: buildDbClient

 def buildDbClient(self, dbClient):
     if not dbClient:
         raise ValueError('DB Client is not specified')
     host = dbClient.getHost()
     hostOsh = modeling.createHostOSH(host)
     processOsh = modeling.createProcessOSH(dbClient.getName(), hostOsh)
     return processOsh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:sybase_dis_physical.py


示例19: createFsmHostOsh

def createFsmHostOsh(fsmHost, ipAddress):
    """
    Creates the Object State Holder of the host where IBM HMC Management Sortware runs
    @param fsmHost: discovered host where IBM HMC runs
    @type fsmHost: instance of Host Data Object
    @param ipAddres: the IP Address of the Host
    @type ipAddress: String
    @return: Object State Holde of the UNIX CI instance
    """
    if fsmHost and ipAddress:
        hostOsh = modeling.createHostOSH(ipAddress, 'unix', None, fsmHost.hostname)
        hostOsh.setStringAttribute('vendor', 'ibm_corp')
        hostOsh.setStringAttribute("os_family", 'unix')
        if fsmHost.domainName:
            hostOsh.setStringAttribute('host_osdomain', fsmHost.domainName)
        if fsmHost.fsmSoftware:
            
#            if fsmHost.fsmSoftware.bios:
#                hostOsh.setStringAttribute('bios_serial_number', fsmHost.fsmSoftware.bios)
                
            if fsmHost.fsmSoftware.versionInformation:
                if fsmHost.fsmSoftware.versionInformation.fullVersion:
                    hostOsh.setStringAttribute('host_osrelease', fsmHost.fsmSoftware.versionInformation.fullVersion)
                if fsmHost.fsmSoftware.versionInformation.baseOSVersion:
                    hostOsh.setStringAttribute('discovered_os_version', fsmHost.fsmSoftware.versionInformation.baseOSVersion)
                    
            if fsmHost.fsmSoftware.typeInformation and fsmHost.fsmSoftware.typeInformation.serialNum:
                hostOsh.setStringAttribute('serial_number', fsmHost.fsmSoftware.typeInformation.serialNum)
                
        return hostOsh
    else:
        logger.reportError('Failed to discover FSM Host')
        raise ValueError("Failed to discover FSM Host")
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:33,代码来源:ibm_fsm.py


示例20: buildDhcpServers

 def buildDhcpServers(self):
     if self.dhcpServerIpList:
         for dhcpIpAddr in self.dhcpServerIpList:
             if ip_addr.isValidIpAddress(dhcpIpAddr, filter_client_ip=True):
                 dhcpHostOsh = modeling.createHostOSH(str(dhcpIpAddr))
                 dhcpAppOsh = modeling.createDhcpOsh(str(dhcpIpAddr), dhcpHostOsh)
                 self.resultVector.add(dhcpHostOsh)
                 self.resultVector.add(dhcpAppOsh)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:8,代码来源:networking_win.py



注:本文中的modeling.createHostOSH函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python modeling.createIpOSH函数代码示例发布时间:2022-05-27
下一篇:
Python models.Monitored类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap