<?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[SSH DCI Collection]]></title><description><![CDATA[<p dir="auto">We have some scripts on Mikrotik routers that generate a JSON string output and would like to start using that in NetXMS for monitoring.  However, any combination I try to get this working seems to end with the DCI being in &lt;&lt; ERROR &gt;&gt; state.  I ran the agent with debug 7 and this is what we get:</p>
<pre><code>2021.11.12 16:16:01.638 *D* [comm.cs.3          ] Requesting metric "SSH.Command(10.0.xxx.xxx:22,"admin","NOTREALPW",":global inPool ""client"";/system script run dhcpPoolMon","",0)"
2021.11.12 16:16:01.638 *D* [ssh                ] AcquireSession: acquired existing session admin@10.0.132.1:22/2
2021.11.12 16:16:01.657 *D* [ssh                ] SSHSession::execute: read error: Remote channel is closed.
2021.11.12 16:16:01.657 *D* [ssh                ] SSH output is empty
</code></pre>
<p dir="auto">I did a bunch of searching and currently have an ssh agent config file which looks like:</p>
<pre><code># cat /etc/nxagentd-ssh-config
HostKeyAlgorithms +ssh-dss
KexAlgorithms +diffie-hellman-group1-sha1
</code></pre>
<p dir="auto">As most others I can of course SSH from the command line on this server to the Mikrotik just fine, use the exact same login / command and get the desired results.  Need some assistance getting this going.  We have the server / agent at 3.9.344 and this is running on an Ubuntu 20.04.3 server.</p>
]]></description><link>https://forum.netxms.org/topic/7244/ssh-dci-collection</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:53:28 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7244.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Nov 2021 22:24:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SSH DCI Collection on Tue, 05 Apr 2022 07:28:30 GMT]]></title><description><![CDATA[<p dir="auto">Actually, agent is already involved in SSH polling. If SSH proxy is not specified server will use it's local agent as a proxy.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/31187</link><guid isPermaLink="true">https://forum.netxms.org/post/31187</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 05 Apr 2022 07:28:30 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Mon, 04 Apr 2022 19:05:20 GMT]]></title><description><![CDATA[<p dir="auto">If I actually remove the agent and let it poll directly from the server with the node containing the credentials I seem to be getting the results now.  Will test this on a larger batch of devices, but hoping with that configuration setup it will work.  No agent involved at all.  Thanks for checking into this!</p>
]]></description><link>https://forum.netxms.org/post/31184</link><guid isPermaLink="true">https://forum.netxms.org/post/31184</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Mon, 04 Apr 2022 19:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Mon, 04 Apr 2022 16:47:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I tried to reproduce this issue with latest agent, but it works as expected for me. Are you sure agent used as a proxy for SSH connection was upgraded to 4.0.2157? If yes, please try to set debug level to 8 and send me excerpt from the log around request for parameter SSH.Command.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/31183</link><guid isPermaLink="true">https://forum.netxms.org/post/31183</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 04 Apr 2022 16:47:10 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Wed, 02 Mar 2022 19:26:45 GMT]]></title><description><![CDATA[<p dir="auto">Was hoping this was resolved in 4.0.2157 as I saw this in release notes:</p>
<ul>
<li>Improved SSH subagent</li>
</ul>
<p dir="auto">The issue still however persists with this release.</p>
]]></description><link>https://forum.netxms.org/post/31105</link><guid isPermaLink="true">https://forum.netxms.org/post/31105</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Wed, 02 Mar 2022 19:26:45 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Sat, 15 Jan 2022 17:07:16 GMT]]></title><description><![CDATA[<p dir="auto">So, after more digging and experimenting, it looks like a bug in libssh (that one: <a href="https://github.com/ParallelSSH/ssh-python/issues/23" rel="nofollow ugc">https://github.com/ParallelSSH/ssh-python/issues/23</a>, <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1849069" rel="nofollow ugc">https://bugzilla.redhat.com/show_bug.cgi?id=1849069</a>), said to be present in libssh versions up to 0.9.5. I've tested agent with libssh 0.9.6 and it works stable as expected. Master branch behaves a bit better with older libssh because of different timing (caused by internal structure changes), but still runs into this error periodically.<br />
Unfortunately, Ubuntu 20 comes with libssh 0.9.3, and I suppose they will not update it to 0.9.6 or newer. I will add workaround for that bug (interpret remote channel closure as success if some data was received before), that should fix it for our purposes.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30926</link><guid isPermaLink="true">https://forum.netxms.org/post/30926</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Sat, 15 Jan 2022 17:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Sat, 15 Jan 2022 10:11:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I did some more accurate testing and it seems to be my failure - I manage to get same error with agent 3.9, but it works fine if built from master branch. So looks like we already fixed something, I just have to find out what exactly <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">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30925</link><guid isPermaLink="true">https://forum.netxms.org/post/30925</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Sat, 15 Jan 2022 10:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Fri, 14 Jan 2022 15:57:37 GMT]]></title><description><![CDATA[<p dir="auto">Ours is running 6.48.6 which is in the long term channel where we like to be.  We might have one running 6.49.1 and I will look around, but we have not yet ventured into the 7.x.x line.  You are a brave man - though you did say it was at home.  I might upgrade my home one to that and see as well.  Is your server Ubuntu 20.04 as well? </p>
<p dir="auto">Could you post the SSH properties setup on the Node and also the General properties for the DCI.  I just keep thinking something is not right on my side.</p>
<p dir="auto">Appreciate the assistance!</p>
]]></description><link>https://forum.netxms.org/post/30924</link><guid isPermaLink="true">https://forum.netxms.org/post/30924</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Fri, 14 Jan 2022 15:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Fri, 14 Jan 2022 15:30:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I just configured it on my home Mikrotik routers and it works, so I suspect it has something to do with Mikrotik firmware version. Mine have 7.1.1 and 6.49.1.<br />
I will also check if I can add additional diagnostic to SSH subagent.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30920</link><guid isPermaLink="true">https://forum.netxms.org/post/30920</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 14 Jan 2022 15:30:35 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Wed, 12 Jan 2022 16:53:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor" aria-label="Profile: Victor">@<bdi>Victor</bdi></a> - Wondering if you have had any opportunity to look into this.  We are running 3.9.420 and still having issues with this.</p>
]]></description><link>https://forum.netxms.org/post/30916</link><guid isPermaLink="true">https://forum.netxms.org/post/30916</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Wed, 12 Jan 2022 16:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Tue, 14 Dec 2021 12:51:38 GMT]]></title><description><![CDATA[<p dir="auto">Here is the Parameter we use for the DCI:</p>
<pre><code>:global inPool "client";/system script run dhcpPoolMon
</code></pre>
<p dir="auto">The script simply counts up the total number of leases available / in use in that DHCP pool and reports back with a JSON formatted response.  The script is:</p>
<pre><code>:global inPool

:local ipUsed 0
:local ipTotal 0
:local nextPool $inPool
:local currPool

# Process the pool passed in and any next pools as one block
:do {
  :set currPool $nextPool
#  Each pool can have multiple ranges listed
  :foreach range in=[/ip pool get "$currPool" ranges] do={
    :local rangeString [:tostr  $range]
    :local ipStart [:toip [:pick $rangeString 0 [:find $rangeString "-"]]]
    :local ipEnd [:toip [:pick $rangeString ([:find $rangeString "-"] + 1) 31]]
    :set ipTotal ($ipTotal + $ipEnd - $ipStart + 1)
#   Read through leases and count ones in this pool
    /ip dhcp-server lease
    :foreach i in=[find] do={
      :local ipActive [:toip [get $i active-address]]
      :if (($ipActive &gt;= $ipStart) &amp;&amp; ($ipActive &lt;= $ipEnd)) do={
        :set ipUsed ($ipUsed + 1)
      }
    }
  }
  :set nextPool [:tostr  [/ip pool get "$currPool" next-pool]]
} while ([:len $nextPool] &gt; 1)

put "{total:$ipTotal, used:$ipUsed}"
</code></pre>
<p dir="auto">That way pools can be expanded prior to being exhausted.  Thanks!</p>
]]></description><link>https://forum.netxms.org/post/30879</link><guid isPermaLink="true">https://forum.netxms.org/post/30879</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Tue, 14 Dec 2021 12:51:38 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Tue, 14 Dec 2021 07:53:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">Could you please share script you are using? I did some tests and otherwise SSH to Mikrotiks seems to be working.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30877</link><guid isPermaLink="true">https://forum.netxms.org/post/30877</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 14 Dec 2021 07:53:49 GMT</pubDate></item><item><title><![CDATA[Reply to SSH DCI Collection on Wed, 24 Nov 2021 20:36:40 GMT]]></title><description><![CDATA[<p dir="auto">Anybody?</p>
]]></description><link>https://forum.netxms.org/post/30803</link><guid isPermaLink="true">https://forum.netxms.org/post/30803</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Wed, 24 Nov 2021 20:36:40 GMT</pubDate></item></channel></rss>