/// <summary> /// List the fullpage monitors /// </summary> private static void ListFullpageAgents(AgentList agentList) { // Add a dummy agent Agent dummy = new Agent(); dummy.Id = "9999"; dummy.Name = "FULLPAGE"; agentList.Add(dummy); dummy.GetFullpageMonitors(apiKey, client, argMonitors); }
/// <summary> /// List the external agent monitors /// </summary> private static void ListExternalAgents(AgentList agentList) { // Add a dummy agent Agent dummy = new Agent(); dummy.Id = "9999"; dummy.Name = "EXTERNAL"; agentList.Add(dummy); dummy.GetExternalMonitors(apiKey, client, argMonitors); }
/// <summary> /// List agents and collect monitor information /// </summary> private static void ListInternalAgents(AgentList agentList) { // Retrieve all the agents defined agentList.GetAgents(apiKey, client); // Process each Agent foreach (Agent agent in agentList) { if (useMonitors) { agent.GetGlobalMonitors(apiKey, client, argMonitors); } if (useProcesses) { agent.GetProcessMonitors(apiKey, client, argProcesses); } } }
/// <summary> /// Process the commands /// </summary> private static void ProcessCommands() { // process the command switch (argCommand) { case "listagents": // create the Agent list AgentList agentList = new AgentList(); if (argAgentTypes.Contains("int")) { ListInternalAgents(agentList); } if (argAgentTypes.Contains("ext")) { ListExternalAgents(agentList); } if (argAgentTypes.Contains("full")) { ListFullpageAgents(agentList); } // Display the results agentList.DisplayAgents(); break; case "setkeys": SetKeys(argApiKey, argSecretKey); break; case "getkeys": Console.WriteLine("APIKey: {0}", GetAPIKey()); Console.WriteLine("SecretKey: {0}", GetSecretKey()); break; } }