<?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[Calculating with multiple oids]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">I would like to monitor router memory usage but in order for that i need to poll 4 seperate values and do some math with them. What would be the cleanest approach to solve this problem?</p>
<p dir="auto">Oids:<br />
.1.3.6.1.2.1.25.2.3.1.3.1 [STRING] = Physical memory<br />
.1.3.6.1.2.1.25.2.3.1.4.1 [INTEGER] = 1024 (hrStorageAllocationUnits)<br />
.1.3.6.1.2.1.25.2.3.1.5.1 [INTEGER] = 160908 (hrStorageSize)<br />
.1.3.6.1.2.1.25.2.3.1.6.1 [INTEGER] = 128164 (hrStorageUsed)</p>
<p dir="auto">Demo math:<br />
125,16*100 / 157,13 = 79,65%</p>
<p dir="auto">Desired output:<br />
Physical memory = 79,65%</p>
]]></description><link>https://forum.netxms.org/topic/7867/calculating-with-multiple-oids</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:49:35 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7867.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Feb 2024 11:15:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Calculating with multiple oids on Tue, 13 Feb 2024 17:04:44 GMT]]></title><description><![CDATA[<p dir="auto">At some point in the future, when <a href="https://track.radensolutions.com/issue/NX-2322" rel="nofollow ugc">https://track.radensolutions.com/issue/NX-2322</a> will be implemented it would be possible to specify muliple OIDs and they will appear as variables in transformation script.</p>
<p dir="auto">For now - either a script DCI that does all SNMP job and calculation and returns final result, or SNMP DCI that reads one OID and the rest being read in transformation script, e.g.:</p>
<pre><code>totalMem = $1;

transport = $node-&gt;createSNMPTransport();
if (transport == null) return null;

freeMem = transport-&gt;getValue(".1.3.6.1.4.1.14823.2.2.1.1.1.11.1.4.1");
if (freeMem == null) return null;

return format(100UL * freeMem / totalMem, 1, 0);
</code></pre>
<p dir="auto">The only bonus of the first approach is that you can perform recalculation for historical collected values.</p>
]]></description><link>https://forum.netxms.org/post/33194</link><guid isPermaLink="true">https://forum.netxms.org/post/33194</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 13 Feb 2024 17:04:44 GMT</pubDate></item></channel></rss>