<?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[Using a template with ExternalParameterShellExec]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">We have a very interesting automation/management challenge. We have a requirement to pull out a value from a LDAP server. We have currently implemented as below;</p>
<p dir="auto">ExternalParameterShellExec=LdapQuery(*):/home/access/ldap.sh $1 $2 $3 $4</p>
<p dir="auto">which in turn executes;</p>
<p dir="auto">ldapsearch -P 2 -D Username -h $1 -w $2 -s sub "(objectclass=XXX)" -b "GUID=$3" -LL $4 | grep "$4" | sed "s/$4: //"</p>
<p dir="auto">However it is deploying the DCI's to the nodes which I can not think of an effective way of doing. We would like a way of managing the TemplatedDCI and Thresholds globally but with local variables configured in the Node. The nodes are currently deployed in a template group which applies other DCI's. All the Nodes that the template is assigned against are networking equipment which can not run nxagentd. The volume of Nodes/DCI's that are needed to be created and maintained would make would make it infeasible to try and do manually.</p>
<p dir="auto">The two approaches that I can think of doing this would be with a DCI like;<br />
LdapQuery(GetCustomAttribute("ip"),GetCustomAttribute("user"),GetCustomAttribute("GUID"),GetCustomAttribute("value")) and having this run on the unit with the LdapQuery configuration set.</p>
<p dir="auto">But this understandably it did not expect a nested function to be called.</p>
<p dir="auto">Or alternatively run it as internal/Dummy and in the script get the CustomAttribute. However I am not sure of a way to call the LdapQuery function remotely.</p>
<p dir="auto">Wondered if anyone else was aware of a different approach?</p>
<p dir="auto">Regards</p>
<p dir="auto">Aron</p>
]]></description><link>https://forum.netxms.org/topic/2875/using-a-template-with-externalparametershellexec</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:53:22 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2875.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Jan 2014 15:51:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using a template with ExternalParameterShellExec on Mon, 27 Jan 2014 10:46:16 GMT]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">Thank you, have applied successfully with the AgentReadParameter. <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="🙂" /></p>
<p dir="auto">Regards</p>
<p dir="auto">Aron</p>
]]></description><link>https://forum.netxms.org/post/12567</link><guid isPermaLink="true">https://forum.netxms.org/post/12567</guid><dc:creator><![CDATA[aron]]></dc:creator><pubDate>Mon, 27 Jan 2014 10:46:16 GMT</pubDate></item><item><title><![CDATA[Reply to Using a template with ExternalParameterShellExec on Sat, 25 Jan 2014 12:16:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I see few possible solutions here.</p>
<ol>
<li>
<p dir="auto">Use dummy DCI, and in transformation script call <a href="http://wiki.netxms.org/wiki/NXSL:AgentReadParameter" rel="nofollow ugc">AgentReadParameter</a> to get LdapQuery from agent with required parameters.</p>
</li>
<li>
<p dir="auto">If values of custom attributes not changing, you can embed them into DCI on template apply time using <a href="https://www.netxms.org/documentation/adminguide/data-collection.html#macros-in-template-items" rel="nofollow ugc">template macros</a>. It could be something like</p>
</li>
</ol>
<pre><code>LdapQuery(%{script:LdapParameters})
</code></pre>
<p dir="auto">and in script library you can create script named LdapParameters like this:</p>
<pre><code>return GetCustomAttribute($node, "ip") . "," . GetCustomAttribute($node, "user") . "," . GetCustomAttribute($node, "GUID") . "," . GetCustomAttribute($node, "value");
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/12557</link><guid isPermaLink="true">https://forum.netxms.org/post/12557</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Sat, 25 Jan 2014 12:16:02 GMT</pubDate></item></channel></rss>