How to remove Routers/Interfaces without losing the history?
search cancel

How to remove Routers/Interfaces without losing the history?

book

Article ID: 126368

calendar_today

Updated On:

Products

Network Flow Analysis

Issue/Introduction

How to remove Routers/Interfaces without losing the history from the MySQL DB?

Environment

Netflow Flow Analysis

Resolution

Example for Router IP Address: xxx.xxx.xxx.xxx

1 - Stop all NFA services on Harvester and NFA Console machines:

2 - Queries to Delete on Harvester machine:

mysql -unetqos -pnetqos
use harvester 
select * from routers where inet6_ntoa(router)='xxx.xxx.xxx.xxx'; (Note the routerID)
select * from interfaces where inet6_ntoa(router)='xxx.xxx.xxx.xxx';

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

select * from persistent_map where routerid='x'; (Inform the routerID from first select)
delete from persistent_map where routerid='x';

NFA Console machine:

mysql -unetqos -pnetqos
use reporter
select ID from routers where deviceName = 'xxx.xxx.xxx.xxx'; (Note the routerID)
select * from interfaces where routerId = 'nnnnnnn'; (Inform the routerID from select above)

delete from routers where deviceName = 'xxx.xxx.xxx.xxx';
delete from interfaces where routerId = 'nnnnnnn'; (Inform the routerID from select above)

delete from routers where id not in (select routerid from interfaces);
delete from agent_definitions where interfaceid not in (select id from interfaces);

3 - Start all NFA services on Harvester and NFA Console machines

4 - Make sure that the desired interfaces show back up and are enabled

5 - Wait 15 minutes to Validate

Additional Information