The following script returns agent information including the cartridge name and cartridge version. It does not work for Java or DotNet agents though. It returns a Null Pointer Exception for Java and DotNet agents.
def agentInfo = "hostName, agentId, agentType, agentName, agentNamespace, agentActive, agentCollectingData, agentVersion, agentTags, cartridgeName, cartridgeVersion \n";
def agentSvc = server.get("AgentService");
def configSvc = server.get("ConfigService");
agentList = agentSvc.findAll();
for (agent in agentList){
hostName = agent.getHostname();
agentId = agent.getId();
agentType = agent.getTypeId();
agentName = agent.getName();
agentNamespace = agent.getAgentNamespace();
agentActive = agent.getIsActive();
agentCollectingData = agent.getIsCollectingData();
//agentHealthState = agent.getHealthState();
agentVersion = agent.getVersion();
agentTags = agent.getTags();
primaryASP = configSvc.getAgentTypePrimaryAsp(agentNamespace, agentType);
cartridgeName = primaryASP.getCartridgeName();
cartridgeVersion = primaryASP.getCartridgeVersion();
agentInfo += "$hostName, $agentId, $agentType, $agentName, $agentNamespace, $agentActive, $agentCollectingData, $agentVersion, $agentTags, $cartridgeName, $cartridgeVersion \n";
}
return agentInfo;
DISCLAIMER
The information in the script provided below 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.
For customization of Foglight, please contact our Professional Services Organization.