Bulk DCI removal
-
I have somehow wound up with a large number of nodes (>1500) that have a DCI that was created by a template dci with instance discovery, but the instance discovery DCI is no longer part of the template. Because of this, if I want to remove these DCI (which I do), I have to go through every node and individually delete each one.
If I go to edit the DCI, I get the popup that says 'This DCI was created through instance discovery' , but there is no instance discovery DCI left on the node.
I am at a loss, it seems there is no way to automate deleting a DCI through API or scripting, and I really don't want to pay someone to go through all of these nodes and sort out which DCI need to be deleted.
Is there a way to bulk delete DCI that I am missing? -
They should've been removed when instance DCI was removed from the template. Also "nxdbmgr check" should handle that, if I remember correctly.
Anyway, you can delete them either via API (e.g. using nxshell or custom java app) or by modifying database directly. I'd recommend API.
Something like this (do not run as-is, just an example):
for node in [o for o in session.allObjects if isinstance(o, objects.Node)]: c = session.openDataCollectionConfiguration() try: items_to_remove = [] for item in c.items: if item.name == 'System.CPU.Usage': items_to_remove.append(item.id) for item_id in items_to_remove: c.deleteObject(item_id) if len(items_to_remove) > 0: c.commit() finally: c.close() -
Thank you, I was able to use this to filter through all my devices and clear out the DCIs that were duplicated.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login