<?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[DCI filter script - how to ignore some filesystems when using {instance} ?]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I have configured Template with DCI: NetXMS Agent, to monitor <em>FileSystem.UsedPerc({instance})</em></p>
<p dir="auto">This will create on each node monitoring of Used disk space on file system for every single drive it founds.</p>
<p dir="auto">However I need to write some script / somewhere to ignore some filesystems, for example, on Windows this is (if instance name contains A: or B: ) because I do not want to monitor floppy disks.</p>
<p dir="auto">Any suggestions, where to write this script / rule and what is syntax ?</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.netxms.org/topic/3140/dci-filter-script-how-to-ignore-some-filesystems-when-using-instance</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:49:50 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/3140.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 May 2014 17:29:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Fri, 29 Sep 2023 03:42:12 GMT]]></title><description><![CDATA[<p dir="auto">To filter CD/DVD and Volume in the "Instance Detection" section, I use this script:</p>
<p dir="auto">type=AgentReadParameter($node, "FileSystem.Type(" . $1 . ")");<br />
if ((type == null) || (type == "") || (type == "CDFS") || (type == "UDF"))<br />
{<br />
return false;<br />
}</p>
<p dir="auto">if (<br />
type != null &amp;&amp; (<br />
type == "aufs" ||<br />
type == "autofs" ||<br />
type == "cgroup" ||<br />
type == "configfs" ||<br />
type == "debugfs" ||<br />
type == "devpts" ||<br />
type == "devtmpfs" ||<br />
type == "fusectl" ||<br />
type == "fuse.gvfsd-fuse" ||<br />
type == "fuse.lxcfs" ||<br />
type == "hugetlbfs" ||<br />
type == "iso9660" ||<br />
type == "mqueue" ||<br />
type == "nfsd" ||<br />
type == "overlay" ||<br />
type == "proc" ||<br />
type == "pstore" ||<br />
type == "rpc_pipefs" ||<br />
type == "securityfs" ||<br />
type == "selinuxfs" ||<br />
type == "squashfs" ||<br />
type == "sysfs" ||<br />
type == "tmpfs"<br />
)) {<br />
return false;<br />
}</p>
<p dir="auto">if (($1 == "/proc") ||<br />
    ($1 like "/proc/*") ||<br />
    ($1 == "/sys") ||<br />
    ($1 like "/sys/*") ||<br />
    ($1 == "/run") ||<br />
    ($1 like "/run/*") ||<br />
    ($1 == "/dev") ||<br />
    ($1 like "*Volume*") ||<br />
    ($1 like "/dev/*"))<br />
  return false;<br />
return true;</p>
]]></description><link>https://forum.netxms.org/post/32849</link><guid isPermaLink="true">https://forum.netxms.org/post/32849</guid><dc:creator><![CDATA[TOLeg]]></dc:creator><pubDate>Fri, 29 Sep 2023 03:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Wed, 05 Apr 2017 08:57:45 GMT]]></title><description><![CDATA[<p dir="auto">Im no programmer but this seemed to work for me.</p>
<p dir="auto">type = AgentReadParameter($node, "FileSystem.Type(" . $1 . ")");<br />
if ((type == null) || (type == "") || (type == "CDFS"))<br />
   return false;<br />
if ($1 ~= "[:/]") {<br />
  return true;<br />
}</p>
]]></description><link>https://forum.netxms.org/post/22110</link><guid isPermaLink="true">https://forum.netxms.org/post/22110</guid><dc:creator><![CDATA[Hanfelt]]></dc:creator><pubDate>Wed, 05 Apr 2017 08:57:45 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Tue, 19 May 2015 06:01:33 GMT]]></title><description><![CDATA[<p dir="auto">Does anyone have any ideas on what I'm doing wrong? I messed with it a little more and had no luck with my testing.</p>
<p dir="auto">Thanks in advance guys!</p>
]]></description><link>https://forum.netxms.org/post/16895</link><guid isPermaLink="true">https://forum.netxms.org/post/16895</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Tue, 19 May 2015 06:01:33 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Mon, 04 May 2015 19:51:54 GMT]]></title><description><![CDATA[<p dir="auto">Some reason that script is not working. I included screen shots maybe I have something wrong.</p>
<p dir="auto">When I change the scrpit to the one I used prior and it locates all the drives. That script is below.</p>
<pre><code>if (rindex($1,":")&gt;0)
{
// if(length($1)&gt;3) return false;
if (rindex($1,"A:")&gt;0) return false;
value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
return (value != null) &amp;&amp; (value &gt; 0);
//return %(true, $1);
}
return false;
</code></pre>
<p dir="auto"> </p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000002283-NetXMS_Pic_1.png" alt="NetXMS Pic 1.png" class="img-markdown  img-fluid" width="762" height="453" /></p>
<p dir="auto"><img src="/assets/uploads/files/smf/0000000002285-NetXMS_Pic_2.png" alt="NetXMS Pic 2.png" class="img-markdown  img-fluid" width="763" height="453" /></p>
]]></description><link>https://forum.netxms.org/post/16743</link><guid isPermaLink="true">https://forum.netxms.org/post/16743</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Mon, 04 May 2015 19:51:54 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Tue, 28 Apr 2015 19:23:03 GMT]]></title><description><![CDATA[<p dir="auto">This script:</p>
<pre><code>if ($1 =~ "[:/]") {
  value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")")
  return (value &gt; 5*1024*1024*1024 &amp;&amp; value &lt; 1*1024*1024*1024*1024);
}
return false;
</code></pre>
<p dir="auto">has few typos - match operation is ~= and semicolon is missing in line 2. It should be</p>
<pre><code>if ($1 ~= "[:/]") {
  value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
  return (value &gt; 5*1024*1024*1024 &amp;&amp; value &lt; 1*1024*1024*1024*1024);
}
return false;
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/16656</link><guid isPermaLink="true">https://forum.netxms.org/post/16656</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 28 Apr 2015 19:23:03 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Tue, 28 Apr 2015 15:59:17 GMT]]></title><description><![CDATA[<p dir="auto">Any Ideas? I'm running Version 2.0-M1 on Windows Server 2008r2. Do I need to upgrade to M2 for the script you provided to work? I'm waiting for M3 to be tested more before I upgrade to that version.</p>
]]></description><link>https://forum.netxms.org/post/16642</link><guid isPermaLink="true">https://forum.netxms.org/post/16642</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Tue, 28 Apr 2015 15:59:17 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Thu, 23 Apr 2015 18:44:18 GMT]]></title><description><![CDATA[<p dir="auto">I tried your suggestion and it did not work for me. Currently I'm using a filter script to ignore CD/DVD drives that report as errors when there is no disk inserted as well as system partitions with no drive letter. I got the script from this post please review below.<br />
 <br />
CURRENT SCRIPT</p>
<pre><code>if (rindex($1,":")&gt;0)
{
// if(length($1)&gt;3) return false;
if (rindex($1,"A:")&gt;0) return false;
value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
return (value != null) &amp;&amp; (value &gt; 0);
//return %(true, $1);
}
return false;
</code></pre>
<p dir="auto">SO for the DCI I created I removed the current script I use and I tried your suggestion and it located all drives and didn't filter anything.</p>
<p dir="auto">NEW SCRIPT</p>
<pre><code>if ($1 =~ "[:/]") {
  value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")")
  return (value &gt; 5*1024*1024*1024 &amp;&amp; value &lt; 1*1024*1024*1024*1024);
}
return false;
</code></pre>
<p dir="auto">For the values you suggested (5*1024*1024*1024) is for 5GB I asume and (1*1024*1024*1024*1024) is for 1TB. If I understand this right, if I wanted to filter drives that are 500GB to 1000GB I would use (value &gt; 512*1024*1024*1024 &amp;&amp; value &lt; 1*1024*1024*1024*1024) Not sure on this and hope its not a stupid question.</p>
]]></description><link>https://forum.netxms.org/post/16586</link><guid isPermaLink="true">https://forum.netxms.org/post/16586</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Thu, 23 Apr 2015 18:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Tue, 21 Apr 2015 20:00:25 GMT]]></title><description><![CDATA[<pre><code>if ($1 =~ "[:/]") {
  value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")")
  return (value &gt; 5*1024*1024*1024 &amp;&amp; value &lt; 1*1024*1024*1024*1024);
}
return false;
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sharpspro" aria-label="Profile: sharpspro">@<bdi>sharpspro</bdi></a> said in <a href="/post/16572">DCI filter script - how to ignore some filesystems when using {instance} ?</a>:</p>
<blockquote>
<p dir="auto">Guys,</p>
<p dir="auto">I'm looking to create a script that will only show drives within a certain size range. For example only show drives that are between 500Gb and 1,000GB or 1,000TB and 1,500GB.</p>
<p dir="auto">The reason being is that i want to setup thresholds differently on drives. Smaller drives i would like to have a higher percentage free than huge drives. The bigger the drive gets the lower i want the percentage free to alert on the threshold.</p>
</blockquote>
]]></description><link>https://forum.netxms.org/post/16573</link><guid isPermaLink="true">https://forum.netxms.org/post/16573</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Tue, 21 Apr 2015 20:00:25 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Thu, 23 Apr 2015 22:12:53 GMT]]></title><description><![CDATA[<p dir="auto">Guys,</p>
<p dir="auto">I'm looking to create a script that will only show drives within a certain size range. For example only show drives that are between 500Gb and 1,000GB or 1,000GB and 1,500GB.</p>
<p dir="auto">The reason being is that i want to setup thresholds differently on drives. Smaller drives i would like to have a higher percentage free than huge drives. The bigger the drive gets the lower i want the percentage free to alert on the threshold.</p>
]]></description><link>https://forum.netxms.org/post/16572</link><guid isPermaLink="true">https://forum.netxms.org/post/16572</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Thu, 23 Apr 2015 22:12:53 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Fri, 27 Mar 2015 18:21:55 GMT]]></title><description><![CDATA[<p dir="auto">Most likely next week, or week after in worst case.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/16235</link><guid isPermaLink="true">https://forum.netxms.org/post/16235</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 27 Mar 2015 18:21:55 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Fri, 27 Mar 2015 18:20:38 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor,</p>
<p dir="auto">Thanks for the reply! When will that version 2.0-M3 be available?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.netxms.org/post/16234</link><guid isPermaLink="true">https://forum.netxms.org/post/16234</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Fri, 27 Mar 2015 18:20:38 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Fri, 27 Mar 2015 11:23:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">in version 2.0-M3 I've added new parameter FileSystem.Type, so with agent version 2.0-M3 you can filter out CDs as following:</p>
<pre><code>if (rindex($1,":")&gt;0)
{
   type = AgentReadParameter($node, "FileSystem.Type(" . $1 . ")");
   // exclude CDs:
   return (value != null) &amp;&amp; (value != "CDFS");
   // if only NTFS systems are of interest (usual situation):
   // return value == "NTFS";
}
return false;
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/16231</link><guid isPermaLink="true">https://forum.netxms.org/post/16231</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 27 Mar 2015 11:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Fri, 27 Mar 2015 03:43:27 GMT]]></title><description><![CDATA[<p dir="auto">The issue I see with this is when a CD disk does not report its value as ERROR and starts reporting the value as "0". An example of this would be when a CD/DVD is put into the drive and the reported value changes from ERROR to 0 (zero) space available and the threshold alert will be sent.</p>
<p dir="auto">My question is, is there a way to exclude CD/DVD drives completely with this filter? Or is there another work around to get this accomplished?</p>
<p dir="auto">Below is how I have the scrpit currently:<br />
if (rindex($1,":")&gt;0)<br />
{<br />
// if(length($1)&gt;3) return false;<br />
if (rindex($1,"A:")&gt;0) return false;<br />
value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");<br />
return (value != null) &amp;&amp; (value &gt; 0);<br />
//return %(true, $1);<br />
}<br />
return false;</p>
]]></description><link>https://forum.netxms.org/post/16224</link><guid isPermaLink="true">https://forum.netxms.org/post/16224</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Fri, 27 Mar 2015 03:43:27 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Thu, 26 Mar 2015 06:14:17 GMT]]></title><description><![CDATA[<p dir="auto">That worked great. Thank you so much!</p>
]]></description><link>https://forum.netxms.org/post/16216</link><guid isPermaLink="true">https://forum.netxms.org/post/16216</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Thu, 26 Mar 2015 06:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Wed, 25 Mar 2015 17:35:06 GMT]]></title><description><![CDATA[<p dir="auto">if (rindex($1,":")&gt;0)   // this is for your case.<br />
{<br />
// if(length($1)&gt;3) return false;    // in some cases, you can link a disc drive to directory. uncomment this line if you don't want to see them.<br />
if (rindex($1,"A:")&gt;0) return false;  // in my case, i have virtual pcs, and some of them have floppy disk drives, i don't want to see them.<br />
value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");<br />
return (value != null) &amp;&amp; (value &gt; 0);<br />
//return %(true, $1);<br />
}<br />
return false;</p>
]]></description><link>https://forum.netxms.org/post/16211</link><guid isPermaLink="true">https://forum.netxms.org/post/16211</guid><dc:creator><![CDATA[mkemerci]]></dc:creator><pubDate>Wed, 25 Mar 2015 17:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Wed, 25 Mar 2015 02:16:37 GMT]]></title><description><![CDATA[<p dir="auto">That script worked great. Is there a way to add to it?</p>
<p dir="auto">I would like for the drives that do not have drive letters to NOT show up e.g. "Percentage of free space on file system \\?\Volume{xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx}\" ----instead I only want it to show valid drives e.g. "Percentage of free space on file system C:\"</p>
<p dir="auto">I will continue to search on this but any help is appreciated.</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000002197-NetXMS.png" alt="NetXMS.png" class="img-markdown  img-fluid" width="909" height="119" /></p>
]]></description><link>https://forum.netxms.org/post/16208</link><guid isPermaLink="true">https://forum.netxms.org/post/16208</guid><dc:creator><![CDATA[sharpspro]]></dc:creator><pubDate>Wed, 25 Mar 2015 02:16:37 GMT</pubDate></item><item><title><![CDATA[Reply to DCI filter script - how to ignore some filesystems when using {instance} ? on Thu, 08 May 2014 13:58:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">You can create filtering script for instance discovery which will attempt to get total space for file system and only return true if data was read successfully and size is non-zero. It could be something like this:</p>
<pre><code>value = AgentReadParameter($node, "FileSystem.Total(" . $1 . ")");
return (value != null) &amp;&amp; (value &gt; 0);
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/13846</link><guid isPermaLink="true">https://forum.netxms.org/post/13846</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 08 May 2014 13:58:55 GMT</pubDate></item></channel></rss>