Retrieve List of Newly Created Devices in DX NetOps Performance Management
search cancel

Retrieve List of Newly Created Devices in DX NetOps Performance Management

book

Article ID: 435178

calendar_today

Updated On:

Products

Network Observability CA Performance Management

Issue/Introduction

You need to retrieve a list of newly onboarded devices in DX NetOps Performance Management (Data Aggregator)Customers often require reporting on devices created within specific timeframes, such as the last 24 hours, the past week, or a custom date range․​​​​‌​‍

 

SYMPTOMS:

  • Need to filter devices by creation time

  • Need API syntax to query the Data Aggregator

CONTEXT: Administrative monitoring of device onboarding activity

IMPACT: Operators require visibility into recently added infrastructure

Environment

  • Product: DX NetOps Performance Management: Any version

  • Component: Data Aggregator (DA)

Resolution

PREREQUISITES:

  • Access to the Data Aggregator REST API

  • Administrator credentials

STEPS:

1․ RETRIEVE DEVICES CREATED IN LAST 24 HOURS

TIME_FILTER=$(date -d '24 hours ago' +%s000)
curl -s -u admin -X POST -H "Content-Type: application/xml" -d "
<FilterSelect xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"filter.xsd\">
  <Filter>
    <Item.CreateTime type=\"GREATER\">$TIME_FILTER</Item.CreateTime>
  </Filter>
  <Select use=\"exclude\" isa=\"exclude\">
    <Item use=\"exclude\">
      <Name use=\"include\"/>
      <CreateTime use=\"include\"/>
    </Item>
    <Device use=\"exclude\">
      <PrimaryIPAddress use=\"include\"/>
    </Device>
  </Select>
</FilterSelect>" https://<DA_host>:8582/rest/devices/filtered | xmllint --format - > /tmp/new_devices_24h.xml
 

EXPECTED: An XML file containing devices added in the last 24 hours

 

2․ RETRIEVE DEVICES CREATED IN LAST 1 OR 2 WEEKS

TIME_FILTER=$(date -d '1 weeks ago' +%s000)
curl -s -u admin -X POST -H "Content-Type: application/xml" -d "
<FilterSelect xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"filter.xsd\">
  <Filter>
    <Item.CreateTime type=\"GREATER\">$TIME_FILTER</Item.CreateTime>
  </Filter>
  <Select use=\"exclude\" isa=\"exclude\">
    <Item use=\"exclude\">
      <Name use=\"include\"/>
      <CreateTime use=\"include\"/>
    </Item>
    <Device use=\"exclude\">
      <PrimaryIPAddress use=\"include\"/>
    </Device>
  </Select>
</FilterSelect>" https://<DA_host>:8582/rest/devices/filtered | xmllint --format - > /tmp/new_devices_1w.xml
 
 
TIME_FILTER=$(date -d '2 weeks ago' +%s000)
curl -s -u admin -X POST -H "Content-Type: application/xml" -d "
<FilterSelect xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"filter.xsd\">
  <Filter>
    <Item.CreateTime type=\"GREATER\">$TIME_FILTER</Item.CreateTime>
  </Filter>
  <Select use=\"exclude\" isa=\"exclude\">
    <Item use=\"exclude\">
      <Name use=\"include\"/>
      <CreateTime use=\"include\"/>
    </Item>
    <Device use=\"exclude\">
      <PrimaryIPAddress use=\"include\"/>
    </Device>
  </Select>
</FilterSelect>" https://<DA_host>:8582/rest/devices/filtered | xmllint --format - > /tmp/new_devices_2w.xml
 

NOTE: Use the same curl payload as Step 1, adjusting the output filename to /tmp/new_devices_1w․xml or /tmp/new_devices_2w․xml

 

3․ RETRIEVE DEVICES IN A CUSTOM DATE RANGE

  • START_DATE="02/27/2026"
  • END_DATE="03/06/2026"

=======================================

START_DATE="02/27/2026"
END_DATE="03/06/2026"
START_TIME=$(date -d "$START_DATE 00:00:00" +%s000)
END_TIME=$(date -d "$END_DATE 23:59:59" +%s000)
curl -s -u admin -X POST -H "Content-Type: application/xml" -d "
<FilterSelect xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"filter.xsd\">
  <Filter>
    <And>
      <Item.CreateTime type=\"GREATER_OR_EQUAL\">$START_TIME</Item.CreateTime>
      <Item.CreateTime type=\"LESS_OR_EQUAL\">$END_TIME</Item.CreateTime>
    </And>
  </Filter>
  <Select use=\"exclude\" isa=\"exclude\">
    <Item use=\"exclude\">
      <Name use=\"include\"/>
      <CreateTime use=\"include\"/>
    </Item>
    <Device use=\"exclude\">
      <PrimaryIPAddress use=\"include\"/>
    </Device>
  </Select>
</FilterSelect>" https://<DA_host>:8582/rest/devices/filtered | xmllint --format - > /tmp/new_devices_interval.xml

 

4․ CREATE BASH SCRIPT FOR CUSTOM DATES

#!/bin/bash

# Check if the user provided dates
if [ -z "$1" ] || [ -z "$2" ]; then
  echo "Usage: ./get_new_devices.sh <START_DATE> <END_DATE>"
  echo "Example: ./get_new_devices.sh 02/27/2026 03/06/2026"
  exit 1
fi

START_TIME=$(date -d "$1 00:00:00" +%s000)
END_TIME=$(date -d "$2 23:59:59" +%s000)

curl -s -u admin -X POST -H "Content-Type: application/xml" -d "
<FilterSelect xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"filter.xsd\">
  <Filter>
    <And>
      <Item.CreateTime type=\"GREATER_OR_EQUAL\">$START_TIME</Item.CreateTime>
      <Item.CreateTime type=\"LESS_OR_EQUAL\">$END_TIME</Item.CreateTime>
    </And>
  </Filter>
  <Select use=\"exclude\" isa=\"exclude\">
    <Item use=\"exclude\">
      <Name use=\"include\"/>
      <CreateTime use=\"include\"/>
    </Item>
    <Device use=\"exclude\">
      <PrimaryIPAddress use=\"include\"/>
    </Device>
  </Select>
</FilterSelect>" http://<DA_Host>:8581/rest/devices/filtered | xmllint --format - > /tmp/new_devices_interval.xml

NOTE: Include the curl POST command from Step 3 using $START_TIME and $END_TIME

EXPECTED: Execute the script using syntax: ․/get_new_devices․sh 02/27/2026 03/06/2026

 

VERIFY SUCCESS:

  • Review the generated XML files in the /tmp directory

  • Confirm the listed devices match the expected timeframe