To turn the collection off for all SQL Server agents, run the following script in the script console
agentService = server.get("AgentService");
configService = server.get("ConfigService");
def agents = agentService.findByAdapterAndType("FglAM", "DB_SQL_Server");
setAspParams(agents, "paecIoDimensionHandlerEnable", "0");
return true;
def setAspParams(agents, aspName, aspValue) {
for (agent in agents) {
def primaryASP = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId());
primaryASP.setValueByString(aspName, aspValue);
configService.saveConfig(primaryASP);
}
}
To turn the collection on for all SQL Server agents, run the following script in the script console
agentService = server.get("AgentService");
configService = server.get("ConfigService");
def agents = agentService.findByAdapterAndType("FglAM", "DB_SQL_Server");
setAspParams(agents, "paecIoDimensionHandlerEnable", "1");
return true;
def setAspParams(agents, aspName, aspValue) {
for (agent in agents) {
def primaryASP = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId());
primaryASP.setValueByString(aspName, aspValue);
configService.saveConfig(primaryASP);
}
}
To turn off the collection for a specific SQL Server agent, update the variable agentName with the SQL Server agent name and then run the following script in the script console
def agentName = "MYAGENTNAME";
def IoDimensionHandler = "false";
// find the agent
def agents = server.get("AgentService").findByName(agentName);
if (agents.size() == 0 ) {
return String.format("Failed to find agent: %s", agentName);
}
if (agents.size() > 1 ) {
return String.format("More than 1 agents were found to: %s", agentName);
}
def agent = agents.get(0);
// update agent ASP
def configService = server.get("ConfigService");
def primaryAsp = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId());
primaryAsp.setValueByString("paecIoDimensionHandlerEnable", IoDimensionHandler);
configService.saveConfig(primaryAsp);
return String.format("Agent %s ASP successfully updated", agentName);
To turn the collection on for a specific SQL Server agent, update the variable agentName with the SQL Server agent name and then run the following script in the script console
def agentName = "MYAGENTNAME";
def IoDimensionHandler = "true";
// find the agent
def agents = server.get("AgentService").findByName(agentName);
if (agents.size() == 0 ) {
return String.format("Failed to find agent: %s", agentName);
}
if (agents.size() > 1 ) {
return String.format("More than 1 agents were found to: %s", agentName);
}
def agent = agents.get(0);
// update agent ASP
def configService = server.get("ConfigService");
def primaryAsp = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId());
primaryAsp.setValueByString("paecIoDimensionHandlerEnable", IoDimensionHandler);
configService.saveConfig(primaryAsp);
return String.format("Agent %s ASP successfully updated", agentName);
To check the status of the collection for all SQL Server agents, run the following script in the script console.
def out = new StringBuilder();
def agentService = server.get("AgentService"); def configService = server.get("ConfigService"); def agents = agentService.findByAdapterAndType("FglAM", "DB_SQL_Server"); for (agent in agents) {
def primaryASP = configService.getAgentInstancePrimaryAsp(agent.getAgentNamespace(), agent.getTypeId(), agent.getId());
if (primaryASP) {
out.append(String.format("%s, %s: paecIoDimensionHandlerEnable=%s\n", agent.getRemoteClientId(), agent.getName(), primaryASP.getString("paecIoDimensionHandlerEnable")));
}
}
return out.toString();
DISCLAIMER:
The information in the script provided is known to work successfully; however, it has not been officially tested by Quest Quality Control. If any of these instructions are changed and/or incorrectly used, intentionally or unintentionally, this solution becomes unsupported by Quest Support and Development.
Quest Support and Development recommend always making a backup of the current Foglight installation and database prior to execution of any scripts that may modify it.