<?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 counting TCP connections without using Agent possible?]]></title><description><![CDATA[<p dir="auto"><a href="/post/2031">https://www.netxms.org/forum/general-support/how-to-countgraphcheck-tcp-connection-states-table-with-netxms/msg2031/#msg2031</a> nicely explains how to do it using the Agent, but I was wondering if there is a way of counting OIDs that match a certain criteria without having to have an Agent installed, as some of this is available via SNMP.</p>
<p dir="auto">For example, OID:</p>
<pre><code>.1.3.6.1.2.1.6.13.1.4.xxx.xxx.xxx.xxx.ssss.yyy.yyy.yyy.yyy.dddd
</code></pre>
<p dir="auto"><a href="http://xxx.xxx.xxx.xxx" rel="nofollow ugc">xxx.xxx.xxx.xxx</a> is the local IP address, and ssss is the local port.<br />
yyy.yyy.yyy.yyy is the remote IP address, and dddd is the remote port.<br />
If I could count the number of times ".1.3.6.1.2.1.6.13.1.4.xxx.xxx.xxx.xxx.ssss.*" appears in the list, I could count how many connections there are to a specific service.</p>
<p dir="auto">Is this possible somehow?</p>
]]></description><link>https://forum.netxms.org/topic/7266/is-counting-tcp-connections-without-using-agent-possible</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:19:54 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7266.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Dec 2021 13:27:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is counting TCP connections without using Agent possible? on Thu, 16 Dec 2021 11:40:46 GMT]]></title><description><![CDATA[<p dir="auto">Thank you.<br />
This Manual page helped immensely: <a href="https://wiki.netxms.org/wiki/NXSL:SNMPWalk" rel="nofollow ugc">https://wiki.netxms.org/wiki/NXSL:SNMPWalk</a></p>
<p dir="auto">The following works perfectly:</p>
<pre><code>// Call this function with the following parameters:
// $1 = port number (eg 5900 for VNC)
// $2 = IP address (xxx.xxx.xxx.xxx)


transport = CreateSNMPTransport($node);
if (transport == null)
           return -1;
oid = ".1.3.6.1.2.1.6.13.1.4." . $2 . "." . $1 ; // IP connections
vars = SNMPWalk(transport, oid);
if (vars == null)
           return -2; // SNMPWalk failed
count = 0;
foreach (v: vars) {
  //trace(1, "SNMP WALK ".v-&gt;name."=".v-&gt;value);
  count = count +1;
}
return count;
</code></pre>
]]></description><link>https://forum.netxms.org/post/30885</link><guid isPermaLink="true">https://forum.netxms.org/post/30885</guid><dc:creator><![CDATA[ChrisC]]></dc:creator><pubDate>Thu, 16 Dec 2021 11:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to Is counting TCP connections without using Agent possible? on Tue, 14 Dec 2021 08:12:16 GMT]]></title><description><![CDATA[<p dir="auto">Yes, you can create a script DCI. Scripts are written using NXSL language, there's support for snmpget and snmpwalk. Here's a simple example, pls inform if you need more information on how to write a script<br />
<a href="https://www.netxms.org/documentation/nxsl-latest/#_read_snmp_value_from_node" rel="nofollow ugc">https://www.netxms.org/documentation/nxsl-latest/#_read_snmp_value_from_node</a></p>
]]></description><link>https://forum.netxms.org/post/30878</link><guid isPermaLink="true">https://forum.netxms.org/post/30878</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 14 Dec 2021 08:12:16 GMT</pubDate></item></channel></rss>