Training on metric data

You can use metric anomaly detection to train on metric data that is sent to Netcool® Operations Insight®.

About this task

Learn how to train metric data to detect anomalies and create analytic policies.

  1. Set the RELEASE environment variable and start the metric training by using the following command:
    Note: The release name is configurable and you must set it as the release environment used. The default release name is evtmanager.
    RELEASE=noi
  2. Run the following command to check that a training schedule has not been configured:
    TRAINER_IP=$(oc get svc|grep ibm-hdm-analytics-dev-trainer|awk '{print $3}')
    oc rsh $(oc get po |grep spark-slave|head -1|awk '{print $1}') curl -X GET --header 'Content-Type: application/json' \
     --header 'Accept: application/json' --header 'X-TenantID: cfd95b7e-3bc7-4006-a4a8-a73a79c71255' \
     "http://${TRAINER_IP}:8080/1.0/training/analytics/metric-manager-anomaly-detection/schedule"

    If a schedule is configured, there is no need to take any further steps. If no schedule is configured, proceed to the next step.

  3. Run the following command:
    oc describe noi | grep CONTAINER_IMAGE.*ea-events-tooling

    An example of the output of the command is:

    --env=CONTAINER_IMAGE=`kubectl describe pod noi-cassandra-0 -n netcool| grep Image: | grep cassandra | head -1 | awk '{$1=""; print $0}' |awk -F'/' '{OFS = FS}{$NF=""; print $0}' | xargs`ea-events-tooling:15.0.0-20220622161201BST \

  4. Copy and paste the text from the output of the command in Step 1 to set an environment variable named CONTAINER_IMAGE.
    Note: Copy the output text except the characters --env= and \.
    View and verify the setting by using the following command:
    echo $CONTAINER_IMAGE
  5. Then, run the following command to execute training manually:
    kubectl run enablemetrictraining -it --restart=Never --env=LICENSE=accept --command=true  \
    --overrides='{"apiVersion":"v1", "spec":{"imagePullSecrets":[{"name":"noi-registry-secret"}]}}' \
    --image=$CONTAINER_IMAGE --image-pull-policy=Always runTraining.sh \
    -- -r $RELEASE -a metric-manager-anomaly-detection -t cfd95b7e-3bc7-4006-a4a8-a73a79c71255

    Where noi-registry-secret is the entitlementSecret that is used in your deployment.

    Note: If you get an error such as a pod exists, then you can complete either of the following steps:
    • Use oc delete pod <name> to remove it.
    • Use a name for the pod that is not currently in use.
  6. Schedule the metric anomaly detection training by running the command:
    kubectl run enablemetrictraining -it --restart=Never --env=LICENSE=accept --command=true  \
    --overrides='{"apiVersion":"v1", "spec":{"imagePullSecrets":[{"name":"noi-registry-secret"}]}}' \
    --image=$CONTAINER_IMAGE --image-pull-policy=Always enableTrainingSchedule.sh \
    -- -r $RELEASE -a metric-manager-anomaly-detection -t cfd95b7e-3bc7-4006-a4a8-a73a79c71255
  7. Repeat step 2 to confirm a training schedule is configured.

What to do next

Click Displaying metric details for an alert to learn how to view an event's metric information obtained by the metric anomaly detection capability.