<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bulk DCI removal]]></title><description><![CDATA[<p dir="auto">I have somehow wound up with a large number of nodes (&gt;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.<br />
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.<br />
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.<br />
Is there a way to bulk delete DCI that I am missing?</p>
]]></description><link>https://forum.netxms.org/topic/7938/bulk-dci-removal</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 15:13:28 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7938.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 May 2024 20:43:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bulk DCI removal on Fri, 10 May 2024 06:49:17 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, I was able to use this to filter through all my devices and clear out the DCIs that were duplicated.</p>
]]></description><link>https://forum.netxms.org/post/33471</link><guid isPermaLink="true">https://forum.netxms.org/post/33471</guid><dc:creator><![CDATA[woodrivercontrols]]></dc:creator><pubDate>Fri, 10 May 2024 06:49:17 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk DCI removal on Tue, 07 May 2024 21:09:10 GMT]]></title><description><![CDATA[<p dir="auto">They should've been removed when instance DCI was removed from the template. Also "nxdbmgr check" should handle that, if I remember correctly.</p>
<p dir="auto">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.</p>
<p dir="auto">Something like this (do not run as-is, just an example):</p>
<pre><code>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) &gt; 0:
            c.commit()
    finally:
        c.close()
</code></pre>
]]></description><link>https://forum.netxms.org/post/33458</link><guid isPermaLink="true">https://forum.netxms.org/post/33458</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Tue, 07 May 2024 21:09:10 GMT</pubDate></item></channel></rss>