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
setProperties
File(ROOT_PATH, RESOURCE_DISCOVERY_PATH + OS_RESOURCE_PATH + MONITOR_PROPERTY_FILE);
"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" Â Â
Â
buildUpdateCommand
buildCreateCommand
buildDeleteCommand
deployMetricUtility
if restart
stopUtility
getRunningPids
deployAndTestConnectionOnMetricPort
isTestUtilityAlreadyDeployed
String command = "cmd /C cscript.exe " + remoteOutputPath + TOOLS_FOLDER + "\\http_get.vbs " + url;
deployMetricTools
     if (redeploy) {         if (!utilityStopped) {           stopUtility();         }
        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 + "\\");
Â
isUtilityAlreadyDeployed
isUtilityRunning
removeMetricUtility
stopUtility
"rmdir /S /Q " + remoteOutputPath; (remoteOutputPath is read from metrics.conf using the utility.remoteOutputPath
)
stopUtility
getRunningPids
cmd = "taskkill /t /F /PID " + pid + " & " + "tskill " + pid;
  executeCommand(cmd);
executeCommand
context.execute("CMD", command, argumentProperties);
Command Result
Command Error