How to delete router and its interfaces through mysql commands

Document ID : KB000004130
Last Modified Date : 03/07/2018
Show Technical Document Details
Introduction:

Sometimes after deleting a router from the NFA admin page, there may be few issues in nfa re-adding this router/interface in NFA. There could be some leftover entries in the mysql database. It may be required to manually delete those entries.

Instructions:

How to remove a router and its interfaces manually from the mysql database on the NFA Harvester:

NFA 9.3.3 and Earlier:
**Note: Due to changes in the MYSQL Database structure, do not run these commands on any later versions of NFA.**

 

1.   Make sure you have deleted the routers and its interfaces from NFA admin page though “Enable Interface” and  “Physical and Virtual” Interfaces tab.

2.   Login to Harvester machine 

3.   Open a command prompt and run the follow commands:

mysql –P3308 poller

select * from routers where address like 'x.x.x.x';  

4.   Note the "id" of the router from the above output. Replace x.x.x.x with the desired IP address of the problematic router. Here we have taken 11 as router id (id) as example.

5.   Continue with the below commands:

delete from routers where id=11; 
delete from interfaces_snmp where routerid=11; 
delete from persistent_map where routerid=11; 
delete from routers_snmp where routerid=11; 
 

use harvester; 
delete from interfaces where router=inet_aton('x.x.x.x'); 
delete from routers where router=inet_aton('x.x.x.x');

6.   Restart CA NFA Harvester and CA NFA Reaper services

************************
NFA 9.3.6 and Later

1. Make sure you have deleted the routers and its interfaces from NFA admin page though “Enable Interface” and  “Physical and Virtual” Interfaces tab.

2. Login to Harvester machine

3.  Open a command prompt and run the follow commands:

MySQL harvester

delete from routers where inet6_ntoa(router)='x.x.x.x';
delete from interfaces where inet6_ntoa(router)='x.x.x.x';

delete from persistent_map where routerid not in (select routerid from from routers);
delete from routers_snmp where routerid not in (select routerid from from routers);
delete from interfaces_snmp where routerid not in (select routerid from from routers);

4. Restart the CA NFA Harvester service

 


 
Additional Information:
Note: Manipulating databases manually may lead to irreversible loss of data if something goes wrong. Kindly contact CA Support if you not sure when/how you have to perform these steps. Ensure you have valid backup before running these commands.