<?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[Total disk space in use of all servers]]></title><description><![CDATA[<p dir="auto">We are planning a move to cloud based servers and I need to gather information about how much disk space is used in total on all disks on all of my servers.</p>
<p dir="auto">I have been able to add a DCI as a template that uses FileSystem.Used({instance}) as the parameter and queries the FileSystem.MountPoints Agent list to add a DCI to every server that enumerates the filesystems and produces the used space in bytes.</p>
<p dir="auto">My ultimate goal is to run this as a DCI summary table on all servers at once, but I have two issues:</p>
<ul>
<li>The DCI I built and applied only works on Windows servers, it doesn't show up for the Linux servers, although the Linux servers do show the system-generated DCIs of "File system: used space on /", etc.</li>
<li>The DCI Summary table won't take {instance} as you can with the DCI.</li>
</ul>
<p dir="auto">Even if it's just something like this, I can work with that and just total everything up in Excel, but it would be nice if I could do this all at once.</p>
<p dir="auto">Server 1 drive <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--smile" style="height:1.4em;width:auto;vertical-align:middle" title="c:" alt="😄" /> xxx bytes<br />
Server 1 drive d: xxx bytes<br />
Server 2 drive / xxx bytes<br />
Server 2 drive /etc xxx bytes</p>
<p dir="auto">What is the best way to accomplish what I need?</p>
<p dir="auto">Thanks for a great product!</p>
]]></description><link>https://forum.netxms.org/topic/5975/total-disk-space-in-use-of-all-servers</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 22:34:49 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5975.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Jun 2019 02:39:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Total disk space in use of all servers on Wed, 12 Jun 2019 17:41:15 GMT]]></title><description><![CDATA[<p dir="auto">It was set to 1.  I have no idea how it got set that way.</p>
<p dir="auto">I set it to 0 and restarted, and it produced results!</p>
<p dir="auto">Is there somewhere in the documentation about scripting that I missed?</p>
<p dir="auto">Thank you for your help!</p>
<p dir="auto">*** FINISHED ***</p>
<p dir="auto">Result: 27706007919104</p>
]]></description><link>https://forum.netxms.org/post/25940</link><guid isPermaLink="true">https://forum.netxms.org/post/25940</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Wed, 12 Jun 2019 17:41:15 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Wed, 12 Jun 2019 07:55:00 GMT]]></title><description><![CDATA[<p dir="auto">Check server configuration variable CheckTrustedNodes - it should be set to 0 (false).</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25933</link><guid isPermaLink="true">https://forum.netxms.org/post/25933</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 12 Jun 2019 07:55:00 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Wed, 12 Jun 2019 03:03:03 GMT]]></title><description><![CDATA[<p dir="auto">I can confirm it is indeed 1.</p>
]]></description><link>https://forum.netxms.org/post/25932</link><guid isPermaLink="true">https://forum.netxms.org/post/25932</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Wed, 12 Jun 2019 03:03:03 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Tue, 11 Jun 2019 22:58:14 GMT]]></title><description><![CDATA[<p dir="auto">When you click on "Entire Network", what's the ID of the Object?<br />
It should (and the script expects it to) be "1" but if for some odd reason it isn't, that'd be a problem.</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000004647-Entire_Network.png" alt="Entire Network.png" class="img-markdown  img-fluid" width="651" height="180" /></p>
]]></description><link>https://forum.netxms.org/post/25931</link><guid isPermaLink="true">https://forum.netxms.org/post/25931</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Tue, 11 Jun 2019 22:58:14 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Tue, 11 Jun 2019 13:21:22 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, I just tried copying &amp; pasting again but got the same error, see attached.  One of the machines I'm testing on has the FileSystem.Used({instance}) enumerated on it just fine and last values reports the data correctly.</p>
<p dir="auto">I'm not sure what I'm doing wrong.</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000004643-error.png" alt="error.png" class="img-markdown  img-fluid" width="623" height="733" /></p>
<p dir="auto"><img src="/assets/uploads/files/smf/0000000004645-error1.png" alt="error1.png" class="img-markdown  img-fluid" width="716" height="371" /></p>
]]></description><link>https://forum.netxms.org/post/25929</link><guid isPermaLink="true">https://forum.netxms.org/post/25929</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Tue, 11 Jun 2019 13:21:22 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Tue, 11 Jun 2019 03:47:48 GMT]]></title><description><![CDATA[<p dir="auto">As you are using a script DCI that goes through every single node in your installation, you can put that DCI on any node, really.<br />
You could create a dummy node, e.g. "AWS" and create the DCI on there.</p>
<p dir="auto">Based on your error, it doesn't like something (the rootObject?) in line</p>
<pre><code>foreach(o : GetObjectChildren(rootObject))
</code></pre>
<p dir="auto">As per the script, initially that'd get the object children of object 1 (which is "Entire Network") and then move down the tree.<br />
I wouldn't think this could break unless there is a typo in the script (direct copy&amp;paste without a single change worked without any issues for me on two different installs) or some kind of database corruption. But Victor might have an idea.</p>
]]></description><link>https://forum.netxms.org/post/25918</link><guid isPermaLink="true">https://forum.netxms.org/post/25918</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Tue, 11 Jun 2019 03:47:48 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Mon, 10 Jun 2019 22:13:28 GMT]]></title><description><![CDATA[<p dir="auto">Thanks!</p>
<p dir="auto">What node do I create the DCI on?  Am I just missing something?</p>
<p dir="auto">I did just copy &amp; paste it into a new script.</p>
]]></description><link>https://forum.netxms.org/post/25916</link><guid isPermaLink="true">https://forum.netxms.org/post/25916</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Mon, 10 Jun 2019 22:13:28 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Mon, 10 Jun 2019 21:17:34 GMT]]></title><description><![CDATA[<p dir="auto">Script works fine on my system. Did you copy&amp;paste or type it?<br />
The reason the script uses FileSystem.Used(*) is because the * <em>in the script</em> is a wildcard, so it catches all such DCIs. It is not the same as an actual DCI on a node.</p>
<p dir="auto">To create a script DCI, create a new DCI and select <strong>Script</strong> under <strong>Origin</strong>. As Parameter you use the name of the script in your Script Library (see attached example for a script called "DCI::GetIPAddresses", obviously yours will be called something else).</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000004621-ScriptDCI.png" alt="ScriptDCI.png" class="img-markdown  img-fluid" width="531" height="338" /></p>
]]></description><link>https://forum.netxms.org/post/25915</link><guid isPermaLink="true">https://forum.netxms.org/post/25915</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Mon, 10 Jun 2019 21:17:34 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Mon, 10 Jun 2019 18:35:08 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Victor.</p>
<p dir="auto">When I try to run it against a node, I get this:</p>
<p dir="auto"><code>Error 14 in line 10: Function or operation argument is not an object</code></p>
<p dir="auto">The server in question has the DCI FileSystem.Used on it and shows all the drives.</p>
<p dir="auto">Also, how do I create a script DCI?  Where do I create that?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.netxms.org/post/25913</link><guid isPermaLink="true">https://forum.netxms.org/post/25913</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Mon, 10 Jun 2019 18:35:08 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Sat, 08 Jun 2019 09:39:59 GMT]]></title><description><![CDATA[<p dir="auto">Yes, you create script in library and then create script DCI specifying this script as parameter name. For testing you can select any container, right click and select "execute server script". You can also add print or trace calls to provide diagnostic. You have to use * as wildcard in FindAllDCIs call.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25893</link><guid isPermaLink="true">https://forum.netxms.org/post/25893</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Sat, 08 Jun 2019 09:39:59 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Thu, 06 Jun 2019 15:02:27 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Victor!</p>
<p dir="auto">Where would I put this?  Does this go in the script library?</p>
<p dir="auto">Also, every time I use FileSystem.Used(*) it never works to enumerate all the instances.  I thought it had to be FileSystem.Used({instance})?</p>
]]></description><link>https://forum.netxms.org/post/25878</link><guid isPermaLink="true">https://forum.netxms.org/post/25878</guid><dc:creator><![CDATA[blairmc96]]></dc:creator><pubDate>Thu, 06 Jun 2019 15:02:27 GMT</pubDate></item><item><title><![CDATA[Reply to Total disk space in use of all servers on Thu, 06 Jun 2019 07:04:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">If you need just one number for total disk space then best approach would be script DCI that will enumerate all servers and add up used disk space. Possible script implementation is following:</p>
<pre><code>// Find "Entire Network" object and start enumeration from it
global TOTAL = 0;
EnumerateNodes(FindObject(1));
return TOTAL;

// This function walks object tree recursively starting from given root
sub EnumerateNodes(rootObject)
{
	// Walk all child objects
	foreach(o : GetObjectChildren(rootObject))
	{
		if (classof(o) == "Node")
		{
			// Process node object
            for(d : FindAllDCIs(o, "FileSystem.Used(*)"))
            {
                v = GetDCIValue(o, d-&gt;id);
                if (v != null)
                {
                    TOTAL += v;
                }
            }
		}
		else
		{
			// For all other objects, go down the tree
			EnumerateNodes(o);
		}
	}
}
</code></pre>
<p dir="auto">You should select right top level object for enumeration. Also this script does not check if same node encountered multiple times - so you either have to pass such rot object under which each node bound exactly once, ar add additional check to avoid duplicates.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25868</link><guid isPermaLink="true">https://forum.netxms.org/post/25868</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 06 Jun 2019 07:04:29 GMT</pubDate></item></channel></rss>