How to remove old archive packages already deleted from the Primary hub archive using LUA script
search cancel

How to remove old archive packages already deleted from the Primary hub archive using LUA script

book

Article ID: 235357

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM) Unified Infrastructure Management for Mainframe

Issue/Introduction

In a UIM installation with secondary hubs, the Archive on the Primary hub is replicated to all secondary hubs (using distsrv? or ADE?).

Old Archive items can be manually deleted from the Primary hub Archive to regain space, but this deletion is not replicated to archives on the secondary hubs.  The UIM Community discussions mention this product weakness, and reference an old field-developed script that can be scheduled to run periodically to remove old items from secondary hub archives which have been deleted from the Primary Hub Archive. Is this script still available?

Environment

Release : 20.1 or higher

Component : UIM - ADE

Cause

- archive cleanup script

Resolution

The script can be found here as its Public:

https://github.com/dan-gill/DX-IM-Scripts/blob/master/Lua/sync-ade.lua

Its essentially a cleanup process.
 
Sync-ade.lua uses the master as the correct copy. If a package exists on a slave ADE and it either doesn’t exist; the version is wrong; or the CRC is different on the master, then the script will delete the package from the slave. This saves anyone from manually cleaning up every remote archive. You choose which packages to retain on the master, the slaves get the same packages and versions.
 
The script takes the following steps:
  • Get a table of all the packages on the master, including version(s) and CRC.
  • Get a list of all running ADE probes, excluding the master.
  • Grab the rules list on each slave with a running ADE probe.
    • Run refresh_rules to ensure rules list is in sync.
    • Get a table of the packages on the slave, including version(s) and CRC.
      • Check each package and version against the master.
        • Delete using distsrv if version is empty.
        • Delete using ADE if version or CRC mismatch.
        • Delete using ADE if package doesn’t exist on master and slave has a version.
  • Restart the slave ADE and distsrv probes to register the changes.

Attachments

1645795221136__sync-ade.lua get_app