agentName = "agent_name"
aspName = "spiecOlapResolverQueryTimeoutSec";
aspValue = "100";
agentService = server.get("AgentService");
configService = server.get("ConfigService");
def getAgentByName(agentName) {
agents = agentService.findByName(agentName);
if ((agents != null) && (agents.size() > 0)) {
return agents.get(0);
} else {
return null;
}
}
def modifyAgentPropertiesPrimary(agentName) {
agent = getAgentByName(agentName);
if (agent == null){
print("agent not found");
return;
}
def namespace = agent.getAgentNamespace();
def agentType = agent.getTypeId();
def primaryAsp = configService.getAgentInstancePrimaryAsp(namespace, agentType, agent.getId());
primaryAsp.setValueByString(aspName, aspValue);
configService.saveConfig(primaryAsp);
}
modifyAgentPropertiesPrimary(agentName);
return true;
Default timeout of 30 seconds is the default for all queries executed against the monitored instance.
agentName = "agent_name"
aspName = "spiecOlapResolverQueryTimeoutSec";
aspValue = "100";
agentService = server.get("AgentService");
configService = server.get("ConfigService");
def getAgentByName(agentName) {
agents = agentService.findByName(agentName);
if ((agents != null) && (agents.size() > 0)) {
return agents.get(0);
} else {
return null;
}
}
def modifyAgentPropertiesPrimary(agentName) {
agent = getAgentByName(agentName);
if (agent == null){
print("agent not found");
return;
}
def namespace = agent.getAgentNamespace();
def agentType = agent.getTypeId();
def primaryAsp = configService.getAgentInstancePrimaryAsp(namespace, agentType, agent.getId());
primaryAsp.setValueByString(aspName, aspValue);
configService.saveConfig(primaryAsp);
}
modifyAgentPropertiesPrimary(agentName);
return true;
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center