cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2024
Views
0
Helpful
3
Replies

Bulk delete of network devices in ISE 2.4

cnegrete
Level 1
Level 1

Hi everyone.

 

I'm banging my head against the wall with this one.

I'm trying to find the best way to do a bulk delete (it's in reality a hostname change) and then add several (hundreds) of devices at a time.

The last thing I tried was to move the devices to a specific "Location" (with the import tool, of course), then search for them in ISE and delete them (and I ended up finding an inconsistency in the ISE UI in which "Export All" exports the filtered devices whereas "Delete All" deletes THE ENTIRE DATABASE - but that's not the question), but having to check the hundreds of checkboxes to use the "Delete Selected" option is impractical.

So, what is to be done here?

* Just change the hostname on the .csv import file doesn't work, it barks about the IP address already in use by the "original" device

* Deleting the individual devices is impractical as there's no "Select All" option to select all the filtered devices, and "Delete All" stupidly deletes everything.

 

Is there a practical option to do this?

 

Thanks for your time.

1 Accepted Solution

Accepted Solutions

pan
Cisco Employee
Cisco Employee

Please try this:

 

Use External restful service:

 

Below curl query will get all network device's ID.

 

curl --insecure --user username:password -X GET \
  https://<PAN node ip address>:9060/ers/config/networkdevice \
  -H 'Accept: application/xml' \
  -H 'Content-Type: application/xml' \

  -H 'X-CSRF-TOKEN: fetch' \
  -H 'cache-control: no-cache'

 

Below query will delete the endpoint:

 

curl --insecure --user username:password -X DELETE \
  https://<PAN node ip address>:9060/ers/config/networkdevice/<replace with id you got from above query> \
  -H 'Accept: application/xml' \
  -H 'Content-Type: application/xml' \
  -H 'X-CSRF-TOKEN: fetch' \
  -H 'cache-control: no-cache'

 

Note you need to replace text highlighted in red

 

The username and password you have to user should have proper permission. Please check below screenshot:

 

ERS.pngERS2.png
 

Hope this reduces your efforts

View solution in original post

3 Replies 3

pan
Cisco Employee
Cisco Employee

Please try this:

 

Use External restful service:

 

Below curl query will get all network device's ID.

 

curl --insecure --user username:password -X GET \
  https://<PAN node ip address>:9060/ers/config/networkdevice \
  -H 'Accept: application/xml' \
  -H 'Content-Type: application/xml' \

  -H 'X-CSRF-TOKEN: fetch' \
  -H 'cache-control: no-cache'

 

Below query will delete the endpoint:

 

curl --insecure --user username:password -X DELETE \
  https://<PAN node ip address>:9060/ers/config/networkdevice/<replace with id you got from above query> \
  -H 'Accept: application/xml' \
  -H 'Content-Type: application/xml' \
  -H 'X-CSRF-TOKEN: fetch' \
  -H 'cache-control: no-cache'

 

Note you need to replace text highlighted in red

 

The username and password you have to user should have proper permission. Please check below screenshot:

 

ERS.pngERS2.png
 

Hope this reduces your efforts

Excellent. I can go from here.
It's a shame you can't just use a file to bulk delete on ISE.
Thanks!!

Please do send feedback through the mechanism built into the menu of ISE