<?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[Is it possible to use text from another SNMP attribute for the legend on Graphs?]]></title><description><![CDATA[<p dir="auto">I am graphing a device via SNMP that has 4 power outputs.<br />
I am displaying the 4 outputs on 1 graph, which works fine, but the names in the Legend are the names of the attribute (ie. "Output 1 Watts" "Output 2 Watts".<br />
Is it possible to use the text string from another SNMP counter for each Legend entry instead?<br />
I know I could just rename each of the attributes that I am graphing, but I am trying to make this generic so I can use it as a template for other devices.</p>
<p dir="auto">Thanks for a great product! I have been watching the intro by Thomas Kirnac, and it looks great!</p>
]]></description><link>https://forum.netxms.org/topic/7139/is-it-possible-to-use-text-from-another-snmp-attribute-for-the-legend-on-graphs</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:48:24 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7139.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Aug 2021 15:38:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is it possible to use text from another SNMP attribute for the legend on Graphs? on Thu, 26 Aug 2021 15:42:27 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for the detailled reply.<br />
I will need to read it several times and then try it!</p>
]]></description><link>https://forum.netxms.org/post/30391</link><guid isPermaLink="true">https://forum.netxms.org/post/30391</guid><dc:creator><![CDATA[ChrisC]]></dc:creator><pubDate>Thu, 26 Aug 2021 15:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to use text from another SNMP attribute for the legend on Graphs? on Tue, 24 Aug 2021 11:06:00 GMT]]></title><description><![CDATA[<p dir="auto">You can use instance discovery mechanism - in this case DCI are created and their names can be used in graphs on Performance tab.</p>
<ul>
<li>Create a script in script library, e.g.:</li>
</ul>
<pre><code>instances = %{ }; // Create empty hash map

instances[".1.1.1"] = "name_one";
instances[".1.1.2"] = "name_two";

return instances;
</code></pre>
<ul>
<li>
<p dir="auto">Create a DCI. In "General" tab in DCI properties there are two macros - {instance} and {instance-name}. E.g. ".1.1.1" from the script will go into {instance}, "name_one" into {instance-name}.</p>
</li>
<li>
<p dir="auto">In "Performance" tab in DCI properties the situation is opposite - {instance} will be filled with "name_one" (this is so for some historical reasons, should be changed in some future releases).</p>
</li>
</ul>
<p dir="auto">Now, when you do Poll-&gt;Instance discovery on a node (or wait when it would happen automatically), the script will be executed, values returned by this script will be used to create/update DCIs.</p>
<p dir="auto">The script in the above example returns hash map. It could also return an array, in that case {instance} would be taken from that array. In instance discovery filter script it's possible to modify or add {instance} and {instance-name}.</p>
<pre><code>return Instance(displayName: "name_one", name: ".1.2.3");
</code></pre>
<p dir="auto">Now wee need to get the legend name. This could be done either from that script in script library or from instance discovery filter script:</p>
<pre><code>transport = $node-&gt;createSNMPTransport();
if (transport != null) {
  legend_name = SNMPGetValue(transport, ".1.2.3.4.1");
}
</code></pre>
<p dir="auto">There are some examples in NXSL docs: <a href="https://www.netxms.org/documentation/nxsl-latest/" rel="nofollow ugc">https://www.netxms.org/documentation/nxsl-latest/</a></p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005537-Screenshot_at_2021-08-24_13-46-52.png" alt="Screenshot at 2021-08-24 13-46-52.png" class="img-markdown  img-fluid" width="914" height="713" /></p>
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005538-Screenshot_at_2021-08-24_13-46-59.png" alt="Screenshot at 2021-08-24 13-46-59.png" class="img-markdown  img-fluid" width="914" height="713" /></p>
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005539-Screenshot_at_2021-08-24_13-55-55.png" alt="Screenshot at 2021-08-24 13-55-55.png" class="img-markdown  img-fluid" width="796" height="700" /></p>
]]></description><link>https://forum.netxms.org/post/30372</link><guid isPermaLink="true">https://forum.netxms.org/post/30372</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 24 Aug 2021 11:06:00 GMT</pubDate></item></channel></rss>