Windows: Deleting inactive S-TAPs in a centralized environment

You can use a cron job on the central manager to delete all inactive S-TAP® instances.

Procedure

  1. Go to Manage > System View > Enterprise S-TAP View.
  2. In the Actions menu, select Add API mapping.
  3. In the Add API Mapping dialog, search for and select delete_inactive_stap.
  4. In the Enterprise S-TAP view, right-click in any row and select Invoke > delete_inactive_stap
  5. Create a script to schedule running this API periodically on the central manager.
    Sample shell script for running the API:
    #!/bin/bash
    
    echo >> ${GUARD_LOG_DIR}/delete_inactive_staps.log
    echo >> ${GUARD_LOG_DIR}/delete_inactive_staps.log
    
    echo Deleteing inactive staps from all managed units $dateStr >> ${GUARD_LOG_DIR}/delete_inactive_staps.log
    date >> ${GUARD_LOG_DIR}/delete_inactive_staps.log
    
    #Run the delete inactive stap command from CM for all S-TAPs on all managed_units
    
    echo -e "grdapi delete_inactive_stap stapHost=all api_target_host=all_managed" | su - cli >> ${GUARD_LOG_DIR}/delete_inactive_staps.log
    
    exit 0
  6. Create a cron job to run the script after the report is refreshed, at whatever interval you decide for both the report refresh and the cron job.