search cancel

How to delete a harvester that is no longer running

book

Article ID: 113685

calendar_today

Updated On:

Products

CA Network Flow Analysis (NetQos / NFA)

Issue/Introduction

We are receiving the below error when trying to delete a Harvester that no longer exists.

- Object reference not set to an instance of an object. at NetQoS.Common.EnumUtility.GetDescriptionByDescriptionContext(Enum value, String descriptionContext) at NetQoS.ReporterAnalyzer.Business.AgentPhysical.InitializeFromDataRow(DataRow row) at NetQoS.Business.DatabaseEntity.GetDatabaseEntityArrayFromDataTable[T](DataTable table) at NetQoS.ReporterAnalyzer.Business.AgentPhysical.GetByInterfaceIds(UInt32[] ids) at NetQoS.ReporterAnalyzer.Business.AgentPhysical.DeleteByInterfaceIds(UInt32[] ids) at NetQoS.ReporterAnalyzer.Business.Interface.DeleteByIds(UInt32[] interfaceIds) at NetQoS.ReporterAnalyzer.Business.Interface.DeleteByRouterIds(UInt32[] routerIds) at NetQoS.ReporterAnalyzer.Business.Router.DeleteByIds(UInt32[] routerIds) at NetQoS.ReporterAnalyzer.Business.Harvester.Delete(UInt32[] ids) at NetQoS.ReporterAnalyzer.WebService.HarvesterWS.DeleteHarvesterData(UInt32 harvesterID) Error when trying to delete interfaces: - Connection must be valid and open. at MySql.Data.MySqlClient.MySqlCommand.CheckState() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at NetQoS.Data.MySqlDataComponentBase.ExecuteNonQuery(MySqlConnection connection, String sql, DataParameter[] dataParameters) at NetQoS.Data.MySqlDataComponentBase.ExecuteNonQuery(String sql) at NetQoS.ReporterAnalyzer.Data.Archive.ArchiveDc.DeleteByRouterAndPersistentId(String sourceTable, UInt32 router, UInt32 persistentId) at NetQoS.ReporterAnalyzer.Business.Agent.DeleteById(UInt32[] ids) at NetQoS.ReporterAnalyzer.Business.Router.DeleteLicensedOnlyByIds(UInt32[] routerIds) at NetQoS.ReporterAnalyzer.WebService.RouterInterfaceWS.DeleteRouterInterfaces(String routerIds, String interfaceIds)

Error when trying to delete interfaces from a harvester that no longer exists:

- Connection must be valid and open.

at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at NetQoS.Data.MySqlDataComponentBase.ExecuteNonQuery(MySqlConnection connection, String sql, DataParameter[] dataParameters)
at NetQoS.Data.MySqlDataComponentBase.ExecuteNonQuery(String sql)
at NetQoS.ReporterAnalyzer.Data.Archive.ArchiveDc.DeleteByRouterAndPersistentId(String sourceTable, UInt32 router, UInt32 persistentId)
at NetQoS.ReporterAnalyzer.Business.Agent.DeleteById(UInt32[] ids)
at NetQoS.ReporterAnalyzer.Business.Router.DeleteLicensedOnlyByIds(UInt32[] routerIds)
at NetQoS.ReporterAnalyzer.WebService.RouterInterfaceWS.DeleteRouterInterfaces(String routerIds, String interfaceIds)

Environment

Release: RAIB1H99000-9.3-Network Flow Analysis-Interface Bundle-Hardware
Component:

Cause

The Console cannot communicate with the old Harvester to delete.

Resolution

We need to remove the harvester manually from the MySQL database.

RDP to the NFA Console.

Backup the NFA Databases as described here:

Backing Up and Restoring Data (broadcom.com)

Then, open a CMD prompt and type:

 

  1. mysql reporter -unetqos -pnetqos
  2. select harvesterid from harvesters where address='x.x.x.x'; (where x.x.x.x is the harvester IP you want to delete).
  3. delete from harvesters where harvesterid=x; (where x is the returned value from the first query)
  4. delete from routers where harvesterid=x;
  5. create table temprouters select id from routers;
  6. delete from interfaces where routerid not in (select id from temprouters);
  7. drop table temprouters;
  8. delete from agent_definitions where interfaceid not in (select id from interfaces);
  9. delete from agent_definitions_deleted where harvesteraddress='x.x.x.x';
  10. truncate table harvester_status;

Restart the CA NFA CA MYSQL Service.