def set_db2_bundle(language=None): framework = ScriptsExecutionManager.getFramework() if (language != None) and (language != 'NA'): Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle( Db2.BUNDLE_NAME, language) else: Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle( Db2.BUNDLE_NAME)
CP11 - Fixed DB2 DSG DISPLAY command handling to handle output for DB2 version 10 CP12 - Change DB2 status check from D OPDATA to D A command ''' import string, re, logger, modeling import eview_lib from appilog.common.system.types import ObjectStateHolder from appilog.common.system.types.vectors import ObjectStateHolderVector from eview_lib import isNotNull, isNull, printSeparator, isnumeric from string import upper from com.hp.ucmdb.discovery.library.clients import ScriptsExecutionManager #from modeling import _CMDB_CLASS_MODEL ''' Variables ''' global Framework PARAM_HOST_ID = 'hostId' UCMDB_VERSION = logger.Version().getVersion(ScriptsExecutionManager.getFramework()) _CMD_PREFIX_DISPLAY_DDF = '%s DISPLAY DDF' _CMD_PREFIX_DISPLAY_GROUP = '%s DISPLAY GROUP' _CMD_PREFIX_DISPLAY_OPDATA = 'D OPDATA' _QRY_LOCATIONS = 'SELECT LOCATION, LINKNAME, PORT, DBALIAS FROM SYSIBM.LOCATIONS' _QRY_DATABASE = 'SELECT NAME, CREATOR, STGROUP, ENCODING_SCHEME, CREATEDTS FROM SYSIBM.SYSDATABASE' _QRY_TABLESPACES = 'SELECT * FROM SYSIBM.SYSTABLESPACE' ''' Classes ''' class Dsg: name = '' level = '' protocolLevel = ''
import file_mon_utils from appilog.common.system.types import ObjectStateHolder from appilog.common.system.types.vectors import ObjectStateHolderVector from java.util import Properties, Date from com.hp.ucmdb.discovery.library.clients.agents import BaseAgent from com.hp.ucmdb.discovery.library.clients import ClientsConsts, ScriptsExecutionManager from com.hp.ucmdb.discovery.library.common import CollectorsParameters import errorobject import errorcodes from eview400_lib import isNotNull, isNull # Global Variables _STR_EMPTY = '' UCMDB_VERSION = logger.Version().getVersion( ScriptsExecutionManager.getFramework()) # iSeries Commands _CMD_EVIEW_VERSION = 'EVDSPPFM eview/version' _CMD_SYSVAL_QMODEL = 'DSPSYSVAL SYSVAL(QMODEL)' _CMD_SYSVAL_QSRLNBR = 'DSPSYSVAL SYSVAL(QSRLNBR)' _CMD_ETHERNET = 'ETHERNET' _CMD_DSPNETA = 'DSPNETA' # Classes class EViewConfFileNameFilter: def accept(self, fileName): return re.search('^ev400_config_.*$', fileName.lower()) is not None
def get_db2_bundle(): framework = ScriptsExecutionManager.getFramework() if Db2.LANG_BUNDLE == None: Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle(Db2.BUNDLE_NAME) return Db2.LANG_BUNDLE
def set_db2_bundle(language=None): framework = ScriptsExecutionManager.getFramework() if (language != None) and (language != "NA"): Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle(Db2.BUNDLE_NAME, language) else: Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle(Db2.BUNDLE_NAME)
def addLog(level, msg, stackTrace=None): ScriptsExecutionManager.addExecutionRecordLog(level, msg)
def _getFramework(): return ScriptsExecutionManager.getFramework()
softwareInfo = applications.InstalledSoftwareInfo(cmdLineToInstalledSoftware, softNameToInstSoftOSH) appSign.setInstalledSoftwareInfo(softwareInfo) appSign.getApplicationsTopology(hostId) if discoverP2P: try: p2p = process_to_process.ProcessToProcess(Framework) p2p.getProcessesToProcess() except: errorMessage = "Failed to run p2p discovery" logWarn(Framework, errorcodes.FAILED_RUNNING_DISCOVERY, ["p2p", protocol], errorMessage) if appSign.crgMap: vector = ObjectStateHolderVector() resultVectors = ScriptsExecutionManager.getFramework().getObjectsForAddOrUpdate() vector.addAll(resultVectors) for osh in vector: oshClass = osh.getObjectClass() # weak node if ( oshClass == "node" and osh.getAttributeValue("host_iscomplete") == 0 and osh.getAttributeValue("host_key") ): ip = osh.getAttributeValue("host_key").split(" ")[0] if ip in appSign.crgMap.keys(): logger.debug("replace weak node:", osh.getAttribute("host_key")) resultVectors.remove(osh) resultVectors.add(appSign.crgMap[ip]) # root container
import string, re, logger, modeling, netutils, shellutils, errormessages import eview_lib from appilog.common.system.types import ObjectStateHolder from appilog.common.system.types.vectors import ObjectStateHolderVector from appilog.common.system.defines import AppilogTypes from java.util import Date from eview_lib import isNotNull, printSeparator, isnumeric, isNull from com.hp.ucmdb.discovery.library.common import CollectorsParameters from com.hp.ucmdb.discovery.library.clients import ScriptsExecutionManager from string import * ''' Variables ''' global Framework UCMDB_VERSION = logger.Version().getVersion(ScriptsExecutionManager.getFramework()) PARAM_HOST_ID = 'hostId' _CMD_F_CEMT_I_SYSTEM = 'F %s,CEMT I SYSTEM' _CMD_F_CEMT_I_DB2CONN = 'F %s,CEMT I DB2CONN' _CMD_F_CEMT_I_MQCONN = 'F %s,CEMT I MQCONN' _CMD_F_CEMT_I_CONN = 'F %s,CEMT I CONN' _CMD_F_ALL_JOBS ='*' ############################################## ## Concatenate strings w/ any object type ## ############################################## def concatenate(*args): return ''.join(map(str,args)) #############################################################
def get_db2_bundle(): framework = ScriptsExecutionManager.getFramework() if Db2.LANG_BUNDLE == None: Db2.LANG_BUNDLE = framework.getEnvironmentInformation().getBundle( Db2.BUNDLE_NAME) return Db2.LANG_BUNDLE