You must perform the following procedure to delete the remote collector manager from VMware Telco Cloud Service Assurance.

Prerequisites

Before deleting a remote data center, ensure that all the collectors running on the data center are deleted or moved to another data center.
  1. Copy the delete_remote.sh file from the VMware Telco Cloud Service Assurance bundle.
    /root/tcx-deployer/scripts/remoteCollectorManager/delete_remote.sh
  2. Change the permission of the delete_remote.sh file:
    chmod +X  delete_remote.sh
  3. Modify the following parameters in the delete_remote.sh script before running.
    • TCSA_URL
    • TCSA_USERNAME
    • TCSA_PASSWORD
    • DC_NAME
  4. Execute the following command:
    bash delete_remote.sh
    The following is an example of the delete_remote.sh script.
    #!/bin/bash
    TCSA_URL=https://TCSA_URL
    TCSA_USERNAME=<TCSA_USERNAME>
    TCSA_PASSWORD='<TCSA_PASSWORD>'
    DC_NAME=<DC_NAME>
    access_token=$(curl -k --location --request POST $TCSA_URL/auth/realms/NGINX/protocol/openid-connect/token --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=password' --data-urlencode 'client_id=operation-ui' --data-urlencode 'username='$TCSA_USERNAME --data-urlencode 'password='$TCSA_PASSWORD | sed "s/{.\"access_token\":\"\([^\"]\).*}/\1/g")
    response=$(curl -o /dev/null -w "%{http_code}" -k -X DELETE --header "Authorization: Bearer $access_token" $TCSA_URL/dcc/v1/remote/datacenters/${DC_NAME})
    if [ $response -eq 200 ]; then
       echo "Remote Collector Manager deregistered from TCSA "
       echo "Stopping the Remote Collector Manager"
       docker rm -f filebeat-custom
       docker stop collector-manager
       echo "Removing The Remote Collector Manager "
       docker rm collector-manager
    elif [ $response -eq 404 ];then
       echo "Error While Deregistering the Remote Collector Manager Not Found"
    else
       echo "Error While Deregistering the Remote Collector Manager There May be Collectors Running on the Remote Collector , Please Delete all the collectors before Removing Collector Manager"
    fi