<?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[Script / Template for windows services]]></title><description><![CDATA[<p dir="auto">I have been trying to make a way so that NETXMS will auto find all services (auto ect) and monitor them, the system supports this for disk space ect but can't seem to map this to services. any ideas or help?</p>
<p dir="auto">ty</p>
]]></description><link>https://forum.netxms.org/topic/5343/script-template-for-windows-services</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:25:55 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5343.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Nov 2017 09:19:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Script / Template for windows services on Thu, 30 Nov 2017 13:33:35 GMT]]></title><description><![CDATA[<p dir="auto">HI twenrich,</p>
<p dir="auto">Thank you!!!! <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> this is a great script, should be standard in the package!!!!</p>
<p dir="auto">The only thing I have noticed is that for some reason, when I add in extra services to 'ignore' it still shows them AdobeUpdateService and alike but am sure that is something I have done / not doing.</p>
<p dir="auto">ty</p>
]]></description><link>https://forum.netxms.org/post/23443</link><guid isPermaLink="true">https://forum.netxms.org/post/23443</guid><dc:creator><![CDATA[theyareseven]]></dc:creator><pubDate>Thu, 30 Nov 2017 13:33:35 GMT</pubDate></item><item><title><![CDATA[Reply to Script / Template for windows services on Wed, 29 Nov 2017 17:10:00 GMT]]></title><description><![CDATA[<p dir="auto">I use a script for instance discovery and a filter script to remove unwanted services.<br />
Additional, custom attributes allow to include and exclude services per node.</p>
<p dir="auto">Please see the attached image for usage in the template DCI.</p>
<p dir="auto">Kind regards,<br />
Thomas</p>
<p dir="auto">Script windows_auto_services:</p>
<pre><code>col_startup = 4;
array a;

table = AgentReadTable($node, "System.Services");
if (table == null)
{
    println "ERROR: Cannot read table from agent";
    return;
}

index = 0;
for (i=0; i&lt;table-&gt;rowCount; i++)
    {
    startup = table-&gt;get(i, col_startup);
    if (startup == "Auto")
        {
        a[index++] = table-&gt;get(i, 0);
        println table-&gt;get(i, 0);
        }
    }

// trace(1, "discover_auto_services: return 0");

return a;
</code></pre>
<p dir="auto">Script filter_windows_services:</p>
<pre><code>sub filter_windows_service(svc)
	{
	attr = GetCustomAttribute($node, "SERVICE_EXCLUDE");
	if (attr != null &amp;&amp; inList(attr, ",", svc))
		{
		trace(1, $node-&gt;name . ": Service " . svc . " excluded by attribute SERVICE_EXCLUDE");
		return false;
		}
	attr = GetCustomAttribute($node, "SERVICE_INCLUDE");
	if (attr != null &amp;&amp; inList(attr, ",", svc))
		return true;

	return
		   (svc != "TBS")
		&amp;&amp; (svc != "KtmRm")
		&amp;&amp; (svc != "iphlpsvc")
		&amp;&amp; (svc != "sppsvc")
		&amp;&amp; (svc != "ShellHWDetection")
		&amp;&amp; (svc != "ccmsetup")
		&amp;&amp; (svc != "SysmonLog")
		&amp;&amp; (!(svc ~= "^clr_optimization_.*") )
		&amp;&amp; svc != "spupdsvc"
		&amp;&amp; svc != "RDSessMgr"
		&amp;&amp; svc != "DPS"
		&amp;&amp; svc != "FontCache"
		&amp;&amp; svc != "MSDTC"
		&amp;&amp; svc != "WinRM"
		&amp;&amp; svc != "gupdate"
		&amp;&amp; svc != "wscsvc"
		&amp;&amp; svc != "VSS"
		&amp;&amp; svc != "wuauserv"
		&amp;&amp; svc != "TrustedInstaller"
		&amp;&amp; svc != "BackupExecAgentAccelerator"
		&amp;&amp; svc != "CcmExec"
		;
	}
</code></pre>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000003820-netxms_template.PNG" alt="netxms_template.PNG" class="img-markdown  img-fluid" width="982" height="333" /></p>
]]></description><link>https://forum.netxms.org/post/23441</link><guid isPermaLink="true">https://forum.netxms.org/post/23441</guid><dc:creator><![CDATA[twenrich]]></dc:creator><pubDate>Wed, 29 Nov 2017 17:10:00 GMT</pubDate></item></channel></rss>