def process(self, context):
        poolOSHV = modelApplicationPool(context)
        if poolOSHV:
            context.resultsVector.addAll(poolOSHV)
        client = context.client
        iisVersion = get_iis_version_by_reg(client)
        if iisVersion:
            self.applicationOsh.setAttribute("application_version_number",
                                             iisVersion)
        else:
            processes = context.application.getProcesses()
            for process in processes:
                fullFileName = process.executablePath
                if fullFileName:
                    fileVer = file_ver_lib.getWindowsWMIFileVer(
                        client, fullFileName)
                    if fileVer:
                        validVer = re.match('\s*(\d+\.\d+)', fileVer)
                        if validVer and validVer.group(1):
                            self.applicationOsh.setAttribute(
                                "application_version_number",
                                validVer.group(1))
                            break

        logger.debug("application ip:", context.application.getApplicationIp())
        hostOsh = modeling.createHostOSH(
            context.application.getApplicationIp())
        self.applicationOsh.setContainer(hostOsh)
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     process = context.application.getProcess(EX_2003_MAIN_PROCESS) 
     if not process:
         process = context.application.getProcess(EX_2007_MAIN_PROCESS)
     
     fullFileName = process.executablePath
     if fullFileName:  
         fileVer = None
         try:
             fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
         except:
             logger.warnException('Get version info using WMI failed')
             
         if fileVer:
             truncatedVersion = re.match('(\d+\.\d+).*',fileVer)
             version = truncatedVersion.group(1)
             if truncatedVersion and FILE_VERSION_TO_PRODUCT_VERSION.has_key(version):
                 applicationOsh.setAttribute("application_version_number", FILE_VERSION_TO_PRODUCT_VERSION[version])
             else:
                 logger.warn('Unknown product version %s' % fileVer)
         else: 
             logger.warn('For file %s no version found.' % fullFileName)
     else:
         logger.warn('Process %s full path is not available.' % process.getName())
Example #3
0
    def process(self, context):
        client = context.client
        applicationOsh = context.application.getOsh()
        process = context.application.getProcess(EX_2003_MAIN_PROCESS)
        if not process:
            process = context.application.getProcess(EX_2007_MAIN_PROCESS)

        fullFileName = process.executablePath
        if fullFileName:
            fileVer = None
            try:
                fileVer = file_ver_lib.getWindowsWMIFileVer(
                    client, fullFileName)
            except:
                logger.warnException('Get version info using WMI failed')

            if fileVer:
                truncatedVersion = re.match('(\d+\.\d+).*', fileVer)
                version = truncatedVersion.group(1)
                if truncatedVersion and FILE_VERSION_TO_PRODUCT_VERSION.has_key(
                        version):
                    applicationOsh.setAttribute(
                        "application_version_number",
                        FILE_VERSION_TO_PRODUCT_VERSION[version])
                else:
                    logger.warn('Unknown product version %s' % fileVer)
            else:
                logger.warn('For file %s no version found.' % fullFileName)
        else:
            logger.warn('Process %s full path is not available.' %
                        process.getName())
 def process(self, context):
     path = self.__process.executablePath
     if path:
         version = file_ver_lib.getWindowsWMIFileVer(self.__client, path)
         if version:
             parsedVersion = self.__parseVersion(version)
             self.__applicationOsh.setAttribute("application_version_number", parsedVersion)
         else:
             logger.debug('Failed getting version for IBM WebSphere MQ using WMI.')
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = getWindowsWMIFileVer(self.__client, self.__path)
     if version:
         if len(version) >= 5:
             version = version[0] + "." + version[1] + "." + version[2:4]
         logger.debug("File version: %s" % version)
         applicationOsh.setAttribute("application_version_number", version)
     else:
         logger.debug("Cannot get file version.")
    def process(self, context):
        client = context.client
        applicationOsh = context.application.getOsh()
        process = context.application.getProcess('Rtvscan.exe') 

        fullFileName = process.executablePath
        if fullFileName:
            fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
            if fileVer:
                applicationOsh.setAttribute("application_version_number", fileVer)
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = getWindowsWMIFileVer(self.__client, self.__path)
     if version:
         match = re.match('\s*(\d+\.\d+)', version)
         if match:
             logger.debug('File version: %s' % match.group(1))
             applicationOsh.setAttribute("application_version_number", match.group(1))        
     else:
         logger.debug('Cannot get file version.')
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = getWindowsWMIFileVer(self.__client, self.__path)
     if version:
         if len(version) >= 5:
             version = version[0]+'.'+version[1]+'.'+version[2:4]
         logger.debug('File version: %s' % version)
         applicationOsh.setAttribute("application_version_number", version)
     else:
         logger.debug('Cannot get file version.')
 def process(self, context):
     applicationOsh = context.application.getOsh()
     for allowedProc in self.__allowedProcesses:
         process = context.application.getProcess(allowedProc)
         if process and process.executablePath:
             processPath = process.executablePath
             rawVersion = getWindowsWMIFileVer(self.__client, processPath)
             if rawVersion:
                 version = re.match(r"\s*(\d+.\d+)", rawVersion)
                 if version:
                     applicationOsh.setAttribute("application_version_number", version.group(1).strip())
    def process(self, context):
        client = context.client
        applicationOsh = context.application.getOsh()
        process = context.application.getProcess('Rtvscan.exe')

        fullFileName = process.executablePath
        if fullFileName:
            fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
            if fileVer:
                applicationOsh.setAttribute("application_version_number",
                                            fileVer)
Example #11
0
 def process(self, context):
     path = self.__process.executablePath
     if path:
         version = file_ver_lib.getWindowsWMIFileVer(self.__client, path)
         if version:
             parsedVersion = self.__parseVersion(version)
             self.__applicationOsh.setAttribute(
                 "application_version_number", parsedVersion)
         else:
             logger.debug(
                 'Failed getting version for IBM WebSphere MQ using WMI.')
Example #12
0
 def process(self, context):
     applicationOsh = context.application.getOsh()
     for allowedProc in self.__allowedProcesses:
         process = context.application.getProcess(allowedProc)
         if process and process.executablePath:
             processPath = process.executablePath
             rawVersion = getWindowsWMIFileVer(self.__client, processPath)
             if rawVersion:
                 version = re.match(r"\s*(\d+.\d+)", rawVersion)
                 if version:
                     applicationOsh.setAttribute("application_version_number", version.group(1).strip())
Example #13
0
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     processes = context.application.getProcesses()
     for process in filter(_processHasExePath, processes):
         fullFileName = process.executablePath
         fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
         if fileVer:
             validVer = re.match('\s*(\d+\.\d+)', fileVer)
             if validVer:
                 applicationOsh.setAttribute("application_version_number",
                                             validVer.group(1))
                 break
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     processes = context.application.getProcesses() 
     for process in processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
             if fileVer:
                 validVer = re.match('\s*(\d+\.\d+)',fileVer)
                 if validVer and validVer.group(1):
                     applicationOsh.setAttribute("application_version_number", validVer.group(1))
                     break
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     processes = context.application.getProcesses() 
     for process in processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
             if fileVer:
                 validVer = re.match('\s*(\d+)\,\s+(\d+)\,\s+(\d*),\s+(\d+)',fileVer)
                 if validVer:
                     readableVer = validVer.group(1).strip()+'.'+validVer.group(2).strip()+'.'+validVer.group(3).strip()+'.'+validVer.group(4).strip()
                     applicationOsh.setAttribute("application_version_number", readableVer)
                     break
 def process(self, context):
     for execFile in LotusDominoVersionFromExecutableByWmiPlugin.TARGET_EXEC_FILES:
         process = context.application.getProcess(execFile)
         if process:
             processPath = process.executablePath
             if processPath:
                 logger.debug("Getting version by process path '%s'" % processPath)
                 try:
                     version = getWindowsWMIFileVer(context.client, processPath)
                     if version:
                         logger.debug("Lotus Domino version found: %s" % version)
                         applicationOsh = context.application.getOsh()
                         applicationOsh.setAttribute("application_version_number", version)
                         break
                 except:
                     logger.debugException("Failed getting version by process path '%s'" % processPath)
Example #17
0
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     processes = context.application.getProcesses()
     for process in processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMIFileVer(
                 client, fullFileName)
             if fileVer:
                 validVer = re.match(
                     '\s*(\d+)\,\s+(\d+)\,\s+(\d*),\s+(\d+)', fileVer)
                 if validVer:
                     readableVer = validVer.group(
                         1).strip() + '.' + validVer.group(
                             2).strip() + '.' + validVer.group(3).strip(
                             ) + '.' + validVer.group(4).strip()
                     applicationOsh.setAttribute(
                         "application_version_number", readableVer)
                     break
 def process(self, context):
     for execFile in LotusDominoVersionFromExecutableByWmiPlugin.TARGET_EXEC_FILES:
         process = context.application.getProcess(execFile)
         if process:
             processPath = process.executablePath
             if processPath:
                 logger.debug("Getting version by process path '%s'" %
                              processPath)
                 try:
                     version = getWindowsWMIFileVer(context.client,
                                                    processPath)
                     if version:
                         logger.debug("Lotus Domino version found: %s" %
                                      version)
                         applicationOsh = context.application.getOsh()
                         applicationOsh.setAttribute(
                             "application_version_number", version)
                         break
                 except:
                     logger.debugException(
                         "Failed getting version by process path '%s'" %
                         processPath)
    def process(self, context):
        poolOSHV = modelApplicationPool(context)
        if poolOSHV:
            context.resultsVector.addAll(poolOSHV)
        client = context.client
        iisVersion = get_iis_version_by_reg(client)
        if iisVersion:
            self.applicationOsh.setAttribute("application_version_number", iisVersion)
        else:
            processes = context.application.getProcesses()
            for process in processes:
                fullFileName = process.executablePath
                if fullFileName:
                    fileVer = file_ver_lib.getWindowsWMIFileVer(client, fullFileName)
                    if fileVer:
                        validVer = re.match('\s*(\d+\.\d+)', fileVer)
                        if validVer and validVer.group(1):
                            self.applicationOsh.setAttribute("application_version_number", validVer.group(1))
                            break

        logger.debug("application ip:", context.application.getApplicationIp())
        hostOsh = modeling.createHostOSH(context.application.getApplicationIp())
        self.applicationOsh.setContainer(hostOsh)