<?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[Count SNMP walk results]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">As a new user to NetXMS I still cannot believe just how easy it is to use.  I have been looking for a replacement to the old RRD based systems for a while and this is blowing everything else away.  I just have a couple of things I am struggling to get worked out (custom scripting seems the way to go with these) that I would like to iron out before I add it to my production.  I have split them in to two posts to keep it simpler.</p>
<p dir="auto">This topic is an SNMP Walk query.  I am trying to work out how I can count the lines in a SNMP Walk.  For example, I might want to count the number of Arp entries where no SNMP OID exists.  I would like to be able to get just a count as an integer from walking 1.3.6.1.2.1.4.22.1.2.  Is this possible?</p>
<p dir="auto">Many thanks.</p>
]]></description><link>https://forum.netxms.org/topic/4511/count-snmp-walk-results</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 18:38:19 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4511.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Jun 2016 19:50:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Count SNMP walk results on Tue, 07 Jun 2016 21:00:59 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, Tomas.  Works perfectly  <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>
]]></description><link>https://forum.netxms.org/post/20060</link><guid isPermaLink="true">https://forum.netxms.org/post/20060</guid><dc:creator><![CDATA[squeezypiano]]></dc:creator><pubDate>Tue, 07 Jun 2016 21:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to Count SNMP walk results on Tue, 07 Jun 2016 20:05:27 GMT]]></title><description><![CDATA[<p dir="auto">Very easy with a "Script" type DCI.</p>
<p dir="auto">Just create a script named "count_ARP_entries" in the script library, and used that for the DCI parameter.<br />
(DCI origin will of course be "Script")</p>
<p dir="auto">For the script, you can do this:</p>
<pre><code>walk_oid = "1.3.6.1.2.1.4.22.1.2";

tube = CreateSNMPTransport($node);
if (tube == null)
  return null;

varbinds = SNMPWalk(tube, walk_oid);
if (varbinds == null)
  return null;

return varbinds-&gt;size;
</code></pre>
<p dir="auto">Refferences:<br />
<a href="https://wiki.netxms.org/wiki/NXSL_Function_Reference" rel="nofollow ugc">https://wiki.netxms.org/wiki/NXSL_Function_Reference</a><br />
<a href="https://wiki.netxms.org/wiki/SG:Script_Examples" rel="nofollow ugc">https://wiki.netxms.org/wiki/SG:Script_Examples</a></p>
]]></description><link>https://forum.netxms.org/post/20057</link><guid isPermaLink="true">https://forum.netxms.org/post/20057</guid><dc:creator><![CDATA[tomaskir]]></dc:creator><pubDate>Tue, 07 Jun 2016 20:05:27 GMT</pubDate></item></channel></rss>