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.
- 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 \
- 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
- 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
- Then, run the following command to execute training
manually:
kubectl run enablesinglemetrictraining -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 theentitlementSecret
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.
- Use
- 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
- Run the following command on the system to verify that the schedule runs
correctly:
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"