How to remove old topology objects from Foglight which have not been updated for a while and are no longer wanted?
Is there a way to do a bulk deletion?
Please find the attached script delete-state-objects.groovy.
The script takes two mandatory parameters, the object type and the number of days older than which you want objects to be deleted. The third parameter is force which indicates that the objects are to be deleted (by default - without the force parameter - the script just lists the objects, it would otherwise delete with the dates and times they were each last updated).
1. The script needs to be run from the command line from %FMS_HOME\bin\
./fglcmd.sh -usr foglight -pwd foglight -cmd script:run -f delete-stale-objects-commandline.groovy Host 12 force
With this call the script deletes any Host objects which have not been updated in the last 12 days.
2. In the Foglight Management Server console navigate to Administration | Tooling | Script Console, then click under "Scripts" tab and click "Add" button
Open attach file delete-stale-objects GUI version.groovy and define the following values for the object type you want to delete and the time:
This is one example done for the Hostprocess and set for the last 30 days: