search cancel

Require removal of multiple devices

book

Article ID: 202595

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

We have to remove a number of devices from PM. We also reviewed the steps provided for doing this and it is quite convoluted in trying to identify for example remove all pingable devices.

Could you prove the best steps to delete all devices with a Type of Pingable

remove pingable devices 

 

Environment

Release : 3.7

Component : IM Reporting / Admin / Configuration

Resolution

1. Get list of pingables in a rest client. Do a post of this body to http://<DA_SYSTEM>:8581/rest/devices/filtered

<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd">
    <Filter>
        <And>
            <Device.SupportedProtocols

type="EQUAL">ICMP</Device.SupportedProtocols>
            <And>
                <Not>
                    <Device.SupportedProtocols type="EQUAL">SNMP</Device.SupportedProtocols>
                </Not>
                <Not>
                    <Item.Name 

type="CONTAINS">DataAggregator:</Item.Name>
                </Not>
            </And>
        </And>
    </Filter>
   
<Select use="exclude" isa="exclude">
   <Device use="exclude">
     <UniqueID use="include"/>
   </Device>
</Select>
</FilterSelect>

-----   You will get results looking like this ---------

<DeviceList>
    <Device version="1.0.0">
        <ID>9905</ID>
    </Device>
    <Device version="1.0.0">
        <ID>9906</ID>
    </Device>
    <Device version="1.0.0">
        <ID>9907</ID>
    </Device>
</DeviceList>

2. You can check some devices to make sure they are pinable by going to URL http://<DA_SYSTEM>:8581/rest/devices/<ID> and getting the IP address, searching for that IP address in monitored devices in the CAPC GUI and verify it is a pingable. 

3. modify the results to be just a list of ID's and add <DeleteList> to the top of the file and </DeleteList> to the bottom and save the file (example name delete.xml)

<DeleteList>
        <ID>9905</ID>
        <ID>9906</ID>
        <ID>9907</ID>
</DeleteList>

4. Then in the rest client do a POST to http://<DA_HOSTNAME>:8581/rest/devices/deletelist of the contents in the file delete.xml.

<DeleteList>
        <ID>9905</ID>
        <ID>9906</ID>
        <ID>9907</ID>
</DeleteList>