The following script can be run in the script console to list the SQL PI agents and their PI repositories and Agent Managers.
piRepositories = [:]; agentService = server.get("AgentService"); configService = server.get("ConfigService"); agentMgmntService = server.get("RemoteAgentManagementService"); fglAMId2NameMap = agentMgmntService.findAllRemoteClients().collectEntries { [(it.id) : it.hostName] } //MsSql fillAgents("DB_SQL_Server", "paecEnable", "parcStorageHost"); //Oracle fillAgents("DB_Oracle", "spiecEnable", "spircStorageHost"); //AzureSQL fillAgents("DB_Azure_Database", "paecEnable", "parcStorageHost"); //MySQLPI fillAgents("DB_MySQL_PI", "paecEnable", "parcStorageHost"); // print out def output = piRepositories.collect { k, v -> """ ${k} ${v.get("totalAgents")} ${v.get("distribution").collect{ fglam, agents -> """++++++++${fglam} ${agents.size()} ++++++++++++++++${agents.join("\n++++++++++++++++")} """ }.join("\n")} """ }.join("--------------------------------\n"); println output return piRepositories; def fillAgents(agentType, flagAsp, hostAsp) { def agents = agentService.findByAdapterAndType("FglAM", agentType); for (agent in agents) { def primaryASP = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId()); if (primaryASP && primaryASP.getBoolean(flagAsp)) { def piHost = primaryASP.getString(hostAsp); def fglAMHost = fglAMId2NameMap.get(agent.getRemoteClientId()); def piHostMap = piRepositories.get(piHost)?:["totalAgents":0, "distribution": [:]]; piRepositories.put(piHost, piHostMap) // count all agents in same PI def agentsList = piHostMap.get("distribution").get(fglAMHost); if (agentsList == null) { agentsList = []; piHostMap.get("distribution").put(fglAMHost, agentsList); } agentsList.add(agent.getName()); piHostMap.put("totalAgents", piHostMap.get("totalAgents") + 1) } } }
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Feedback 利用規約 プライバシー Cookie Preference Center