How to cleanup bogus interfaces in NFA without losing data.

Document ID : KB000008513
Last Modified Date : 24/05/2018
Show Technical Document Details
Issue:

If you had dual netflow configurations set (Flexible and Traditional), you may have a mess of bogus interfaces to clean up. The bogus interfaces look like below:

dualStream.png

Environment:
NFA 9.1+Windows Server 2008Windows Server 2012RedHat Linux
Cause:

NFA code does not know how to handle dual netflow streams. For more information on this issue please see TEC1488654. This is an issue that needs to be resolved on the router configuration. 

Resolution:

Assuming the router configuration issue was already resolved, we can use this clean procedure. This procedure will cleanup bogus interfaces that came about for devices with SNMP connectivity only. If a device does not have an SNMP profile assigned, this procedure will not affect the device. If the historical data is not important, we recommend using this method: TEC1488654

For NFA 9.3.3:

1. RDP to NFA harvester and open a CMD prompt and type in this exact order:

a. mysqldump harvester > C:/harvesterbackup4cleanup.sql

b. mysqldump poller > C:/pollerbackup4cleanup.sql

c. mysql poller

d. delete p.* from persistent_map p inner join routers r on p.routerid=r.id where r.profileid!=0 and p.valid=0 and p.ifindex>1;

e. use harvester

f. truncate table routers;

g. truncate table interfaces;

2. Restart the CA NFA Harvester Service

3. RDP to NFA Console server and open a CMD prompt and type: 

a. mysqldump reporter > C:/NFA_Backup/reporterbackup.sql

b. mysql reporter

c. CREATE TABLE temprouters (  ID int(10) unsigned );

d. Insert into temprouters (ID) select id from routers where profileid!=0;

e. DELETE FROM interfaces WHERE name like 'Interface %' and EXISTS (select id from temprouters where interfaces.routerid=temprouters.id);

f. Drop table temprouters;

g. DELETE FROM agent_definitions WHERE interfaceid NOT IN (SELECT id FROM interfaces);

For NFA 9.3.6 and later:

1. RDP to NFA harvester and open a CMD prompt and type in this exact order:

a. mysqldump harvester > C:/harvesterbackup4cleanup.sql

b. mysql harvester

c. delete p.* from persistent_map p inner join routers r on p.routerid=r.routerid where r.profileid!=0 and p.valid=0 and p.ifindex>1;

d. delete from interfaces;

2. Restart the CA NFA Harvester Service

3. RDP to NFA Console server and open a CMD prompt and type: 

a. mysqldump reporter > C:/reporterbackup4cleanup.sql

b. mysql reporter

c. CREATE TABLE temprouters (  ID int(10) unsigned );

d. Insert into temprouters (ID) select id from routers where profileid!=0;

e. DELETE FROM interfaces WHERE name like 'Interface %' and EXISTS (select id from temprouters where interfaces.routerid=temprouters.id);

f. Drop table temprouters;

g. DELETE FROM agent_definitions WHERE interfaceid NOT IN (SELECT id FROM interfaces);

Additional Information:

Please contact CA Support if you have a device without SNMP connectivity that you need to clean up bogus interfaces.