NetOps Portal Device ItemID to Data Aggregator Item_ID value translation
search cancel

NetOps Portal Device ItemID to Data Aggregator Item_ID value translation

book

Article ID: 406055

calendar_today

Updated On:

Products

Network Observability CA Performance Management

Issue/Introduction

We are able to identify the Portal ItemID for a device that's been added to the environment.

We want to translate that to the ID used by the Data Aggregator in the DR DB Vertica database, the Item_ID value. This is represented by the LocalID column value in the Portal MySql netqosportal.dst_device table data.

The goal is using the LocalID to add a new device to group memberships using REST.

We are developing an API driven tool to allow non-administrative people to discover a device and put in a specified group as needed.  We use the rules for standard device management. I used the KB here to add a device to the group but unable to translate the Device ID to the needed ItemID that is required for the group via odata/rest.

Environment

All supported Network Observability DX NetOps Performance Management releases

Resolution

NOTE: For all URLs below:

  • Assumes use of HTTPS for scheme, and port 8182. Change as needed.
  • Replace <PortalHost> with your Portal host name.
  • Replace <userName> with your username and enter password when prompted. If scripting will need to add/embed the password.
  • Replace <DA_ID> with the DA Data Source ID.

Identify the Data Aggregator Data Source ID used by NetOps. Use this URL in a browser or a REST client.

  • Browser URL:
    • https://<PortalHost>:8182/pc/center/webservice/datasources/
  • Curl alternative:
    • curl -v -u <userName> https://<PortalHost>:8182/pc/center/webservice/datasources/

Note the "<type>DATA_AGGREGATOR</type>" entry and it's "<ID#></id>" value. Sample output. A common ID for a DA in a clean system is 3, your ID may vary.

<dataSource>
<id>3</id>
<type>DATA_AGGREGATOR</type>


Use the following in a curl command to determine the ItemID Portal ID mapping to the DA LocalID (Portal) aka Item_ID from the DR DB.

  • curl -v -X POST -u <userName> -H "Content-Type: application/xml" -d @/tmp/ItemID-to-LocalID.out https://<PortalHost>:8182/pc/center/webservice/datasources/dataSourceId/<DA_ID>/localids

It uses a file created in the /tmp directory. Change the file storage location and name as needed. The file contains, in this sample, a known Portal ItemID. Add additional "<ItemID ID="1234"/> lines as needed.

[root@<PortalHost> tmp]# cat /tmp/ItemID-to-LocalID.out
<ItemIDs>
<ItemID ID="71043"/>
</ItemIDs>
[root@<PortalHost> tmp]#

The output from the curl command will show the translated IDs. This is a sample from the 71043 sample ID in the sample file. It tells us the DA Item_ID, known as LocalID in Portal, is 259737.

<?xml version="1.0" encoding="UTF-8"?>
<ItemIDResults>
<ItemIDResult LocalID="259737" ItemID="71043"/>
</ItemIDResults>

 

Looking for Data Aggregator Item_ID (aka LocalID in Portal) to Portal ItemID value translation?

Create a file with the following in it, using your target Item_ID values.

[root@<PortalHost> tmp]# cat /tmp/LocalID-to-ItemID.out
<LocalIDs>
<LocalID ID="259737"/>
</LocalIDs>
[root@<PortalHost> tmp]#

Issue a curl POST call to the itemids URL:

  • curl -v -X POST -u <userName> -H "Content-Type: application/xml" -d @/tmp/ItemID-to-LocalID.out https://<PortalHost>:8182/pc/center/webservice/datasources/dataSourceId/<DA_ID>/itemids

The output from the curl command will show the translated IDs. This is a sample from the 259737 sample ID in the sample file. It tells us the Portal ItemID 71043 aligns with DA Item_ID 259737.

<?xml version="1.0" encoding="UTF-8"?>
<ItemIDResults>
<ItemIDResult LocalID="259737" ItemID="71043"/>
</ItemIDResults>

Additional Information

A simple validation check can be performed by reviewing the ID listed for the target device in the Portal DA inventory. Go to Administration -> Monitored Items Management -> Monitored Items. Find the target device and note the ID on it's Details tab information.