Diagnosing Metrics Collection (metrics process)

Problem

I need to diagnose the collection of (or lack of) metrics in the CAM product

Description/Solution

The ability to assign locations to a scan jobs allows the attaching of geographic information to targets identified by scan job. The location is not associated with the appliance but is associated with the scan job. This allows scan jobs executed by a single appliance to be associated with multiple locations.

Sequence of Steps

  1. setProperties

    1. File(ROOT_PATH, RESOURCE_DISCOVERY_PATH + OS_RESOURCE_PATH + MONITOR_PROPERTY_FILE);

    2. "utility.metricsScriptPath" "utility.fileName" "utility.fileVersion" "utility.outputPath" "utility.ToolsPath" "utility.remoteOutputPath" "utility.samplePeriod" "utility.collectionPeriod" "utility.collectionDuration" "utility.url"    String applianceIp = System.getenv("HOST_IP_ADDRESS") != null ? System.getenv("HOST_IP_ADDRESS") : getLocalIPAddress();    url = url.replace("{_IP_}", applianceIp); "utility.enabled" "utility.redeploy" "SYS_TEMPLATE" "NET_TEMPLATE" "DISK_IOPS_TEMPLATE"    

       

  2. buildUpdateCommand

  3. buildCreateCommand

  4. buildDeleteCommand

  5. deployMetricUtility

    1. if restart stopUtility

  6. getRunningPids

  7. deployAndTestConnectionOnMetricPort

    1. isTestUtilityAlreadyDeployed

    2. String command = "cmd /C cscript.exe " + remoteOutputPath + TOOLS_FOLDER + "\\http_get.vbs " + url;

  8. deployMetricTools

    1.           if (redeploy) {                 if (!utilityStopped) {                     stopUtility();                 }
    2.                 removeMetricUtility();                 executeCommand("mkdir " + remoteOutputPath + TOOLS_FOLDER);                 String winScript = ROOT_PATH + "tools/windows/metrics/"                         + utilityFileName + "_" + utilityFileVersion + ".vbs";                 context.execute("SMBU", new File(winScript).getAbsolutePath() + ";" + remoteOutputPath + TOOLS_FOLDER + "\\");

       

  9. isUtilityAlreadyDeployed

  10. isUtilityRunning

  11. removeMetricUtility

    1. stopUtility

    2. "rmdir /S /Q " + remoteOutputPath; (remoteOutputPath is read from metrics.conf using the utility.remoteOutputPath)

  12. stopUtility

    1. getRunningPids

    2. cmd = "taskkill /t /F /PID " + pid + " & " + "tskill " + pid;

    3.    executeCommand(cmd);

  13. executeCommand

    1. context.execute("CMD", command, argumentProperties);

      1. Command Result

      2. Command Error