Unable to Discover a Device in DX NetOps PM After the Data Collector to Which the Device Was Assigned Was Deleted Through Data Aggregator REST API
search cancel

Unable to Discover a Device in DX NetOps PM After the Data Collector to Which the Device Was Assigned Was Deleted Through Data Aggregator REST API

book

Article ID: 369840

calendar_today

Updated On:

Products

DX NetOps

Issue/Introduction

We are encountering an issue where a device cannot be discovered or monitored in DX NetOps Performance Management (PM) because its assigned Data Collector was deleted using the REST API. As a result, the device remains in an undefined state, preventing proper discovery and monitoring.

Scenario:

Suppose device X is being monitored by Data Collector Y. Due to infrastructure changes, the network administrator decides to delete Data Collector Y via the Data Aggregator REST API:

http://DA:8581/rest/dcms/<ItemID of DC>

As a result, device X moves into an undefined state because its associated Data Collector no longer exists. Within the Data Aggregator device admin page, the administrator is unable to assign a new Data Collector to rediscover the device because the dropdown menu is greyed out.

Environment

DX NetOps Performance Management All releases

Cause

The issue arises when a device in DX NetOps Performance Management (PM) becomes associated with a Data Collector that was deleted using the REST API. This deletion leaves the device in an undefined state, thereby preventing it from being properly discovered and monitored within the system.

Resolution

To address the issue where a device cannot be discovered or monitored in DX NetOps Performance Management (PM) due to the deletion of its assigned Data Collector, follow these steps:

Note: Deleting a Data Collector via the REST API can leave devices in an undefined state. Therefore, it is not recommended to delete a Data Collector if it is currently monitoring devices.

The only way to rediscover the device is by assigning a new Data Collector using the REST API. Follow these steps to update the MDRItemID for each device:

  1. Determine the new Data Collector ID: Identify the MDRItemID of the new Data Collector that will monitor the device.

  2. Generate a List of Devices on the Deleted Data Collector: Run the following commands to list the devices assigned to the deleted Data Collector and save the list to /tmp/devices.txt:

Login to Data Repository - Connect to the Vertica Database and execute the following commands
 
vsql>\t
vsql>\a
vsql>\o /tmp/devices.txt
vsql>select item_id from dim_item d where exists (select null from attribute_instance ai where ai.item_id=d.item_id and attribute_id=(select attribute_id from v_attribute where attr_qname like '%}Item.MDRItemID' limit 1) and long_value=9902383);
vsql>\q
  1. Update the MDRItemID for Each Device: Use the following script to update the MDRItemID for each device listed in /tmp/devices.txt:
 
for itemid in `cat /tmp/devices.txt`
do
curl -X PUT -u <USER>:<PASSWORD> -H 'Content-Type: application/xml' -d'<Device version="1.0.0"><Item version="1.0.0"><MDRItemID>NEW_COLLECTOR_ID</MDRItemID></Item></Device>' http://<DA_SYSTEM>:<PORT>/rest/devices/$itemid
done

Replace <USER>, <PASSWORD>, <DA_SYSTEM>, <PORT>, and NEW_COLLECTOR_ID with the appropriate values.

Summary:

  • Deleting a Data Collector via the REST API can leave devices in an undefined state. 
  • Rediscovery requires reassigning the device to a new Data Collector using the REST API.
  • Update the MDRItemID for the device to ensure proper monitoring.