How to delete a harvester that is no longer running
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

Needs to deleted Harvester remains present under NetOps Portal / System Health

Also is 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

Network Flow Analysis all versions

Cause

The Console cannot communicate with the old Harvester to delete or remains present under NetOps Portal / System Health

Resolution

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

RDP to the NFA Console.

Backup the NFA Databases as described here:

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/network-flow-analysis/23-3/managing/maintenance-and-data-collection/backing-up-and-restoring-data.html

 

Then, open a CMD prompt and type:

 

mysql reporter -unetqos -pnetqos

 

select harvesterid from harvesters where address='x.x.x.x'; (where x.x.x.x is the harvester IP you want to delete)

delete from harvesters where harvesterid=x; (where x is the returned value from the first query)

delete from routers where harvesterID = (select harvesterID from harvester_status where Address = 'x.x.x.x');

create table temprouters select id from routers;

delete from interfaces where routerid not in (select id from temprouters);

drop table temprouters;

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

delete from agent_definitions_deleted where harvesteraddress='x.x.x.x';

delete from cpuutilization where Address = (select Address from harvester_status where Address = 'x.x.x.x');

delete from harvester_status where Address = 'x.x.x.x';

 

So, for example:
mysql reporter -unetqos -pnetqos  -t -e "delete from harvester_status where address='10.0.0.101';"

 

Restart the CA NFA CA MYSQL Service.