AIOps

 View Only
Expand all | Collapse all

Purge old/deleted resources in File Observer

  • 1.  Purge old/deleted resources in File Observer

    Posted Mon November 29, 2021 02:16 PM
    I am working with a ASM File Observer to load topology from ScienceLogic. I had an initial load and then I noticed the mergeTokens was too generic, for instance, 'db2inst1'. So, I tried to delete the wrong resources, fix the input file and load again. To delete, I loaded an empty file. I can see in Topology Viewer the resources are deleted. However, when I am trying to load a new/fixed file, it seems to keep the old/wrong merge token, from the deleted resources. As a result, it is messing up the topology.

    Question: How can I 'purge' the old deleted resources from ASM (File Observer)? Note: I can see the the delete resources in the Search results page if I toggle on the option "Include delete resources".

    Any help is appreciated. Thanks in advance, Fernando.

    ------------------------------
    Fernando Cavalcanti
    ------------------------------


  • 2.  RE: Purge old/deleted resources in File Observer

    User Group Leader
    Posted Wed December 08, 2021 11:50 AM

    An empty file will not delete the items ; you need to issue a Delete statement for each resource you put in  eg

    D:c85d9b32-abf7-4bc6-a534-90336cef187f
    D:7647a1eb-4540-4e97-8243-bf8f2fded712

    Thanks to John Postoyko for this answer.



    ------------------------------
    Angus Jamieson
    IT Service Management Solutions Architect
    IBM
    Edinburgh
    ------------------------------



  • 3.  RE: Purge old/deleted resources in File Observer

    Posted Thu December 09, 2021 08:30 AM
    Hi Angus, I ended up running a clean up script and reloading the topology. Then it worked.

    See below the script I ran to cleanup ASM. NOTE: 'noi-hybrid' is the name of my NOI release, so it needs to be updated accordingly while running it.

    $ cat cleanupASM.sh
    #!/bin/bash
    set -e
    oc scale deployment -l release=noi-hybrid-topology --replicas=0
    oc exec noi-hybrid-topology-elasticsearch-0 -- bash -c 'curl -X DELETE http://localhost:9200/searchservice*'
    oc exec noi-hybrid-cassandra-0 -- bash -c 'cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -e "DROP KEYSPACE janusgraph"'
    oc scale deployment -l release=noi-hybrid-topology --replicas=1
    echo "All topology data should have been removed."
    echo "Done!"


    ------------------------------
    Fernando Cavalcanti
    ------------------------------