Delete only specific entries from "Not Present" items using "remove_not_present_items.sh" script
search cancel

Delete only specific entries from "Not Present" items using "remove_not_present_items.sh" script

book

Article ID: 191319

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

Sometimes it could be needed to delete only some specific entries (e.g. 'QoS Class Map' entries) coming from old "Not Present" items.
This may be useful in order to keep other data from those same "Not Present" items, apart the entries we want to filter (QoS Class Map in this example).

Environment

Dx NetOps Performance Management all versions

Resolution

This could be done using the "remove_not_present_items.sh" script available on the Data Aggregator system in the directory /opt/IMDataAggregator/scripts 

This script can be customized for different filter criteria.
The filtering examples/options are provided to allow taking an approach that deletes the 'not present' items on a subset of devices specified by a filter.

For example, the option:
[-z <filter by facet type>]

results into:
<Pollable.SourceFacetTypes type="CONTAINS">$FILTERFACETTYPE</Pollable.SourceFacetTypes>

As an example, looking at the REST output for QosClassMaps, can see:

<Pollable version="1.1.1">
<IsExcludedFromReports>false</IsExcludedFromReports>
<SourceFacetTypesList>
<SourceFacetTypes>
{http://im.ca.com/normalizer}NormalizedQosClassMapInfo
</SourceFacetTypes>
</SourceFacetTypesList>
<PollRate>FAST</PollRate>
<IsPollEnabled>true</IsPollEnabled>
<IsPolled>true</IsPolled>
</Pollable>


So to set the QosClassMaps filter in the script this option ca be used:

-z NormalizedQosClassMapInfo


Note:

The '-o' option (used to get an output file) appears to override the '-z' option. So should not be used in this case.

The '-F' option will not actually do the delete operation, and can give a list of the items, so it can be used to test what can be deleted.


For example, running this command:

  ./remove_not_present_items.sh -z NormalizedQosClassMapInfo -F -h <host_name>

will print a result similar to this:

####### RESULT OF SEARCH  ##########################
Items found to be deleted:  1

Would you like to list the names of the items?
Select 1 for yes; 2 for no

Yes
No
#? 1
********** Not Present Item List ****************
cbQoS Fa3/4/UnknownPolicy/class-default-...

********** Not Present Item List End*************
######### NOT PRESENT ITEM DELETION ###############


showing the list of items that will be delete by running the script as above without the -F option.

Additional Information

Refer to the CA PM docs here:
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/performance-management/3-7/building/manage-devices/delete-components-that-are-not-present.html