<?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[Example of how to setup SSH script/commands?]]></title><description><![CDATA[<p dir="auto">I'm slowly getting more comfortable with NetXMS but unfortunately it can be difficult to find out how to actually implement things at times <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /> One of these is how to send SSH commands to a device. I've googled and seen this is possible but I can't find any actual examples to help set it up</p>
<p dir="auto">I want to be able to be able to send commands via SSH to a device. A simple example being I have created a DCI summary table to show MikroTik RouterOS versions. I want to be able to select all that are outdated, right click, choose Tools-&gt;MikroTik Commands-&gt;Update RouterOS<br />
And in the background NetXMS would connect to the device with SSH and execute '/system package update install'</p>
<p dir="auto">How do I set this up?<br />
Then once I get the basics working, is it possible to parse more advanced commands via SSH? I.e. using variables so I could choose 'Update RouterOS' but specify a time as a variable and it would send<br />
'/system scheduler add on-event="/system package update install" start-time=$NetXMSTimeVariable'<br />
So the device would update at 3:30am instead of immediately</p>
]]></description><link>https://forum.netxms.org/topic/5962/example-of-how-to-setup-ssh-script-commands</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 17:50:05 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5962.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 May 2019 05:16:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Example of how to setup SSH script/commands? on Sun, 18 Aug 2019 10:18:05 GMT]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">Millenium7, did you get ssh script working ? I could use some examples also, how to get basic ssh commands working.</p>
<p dir="auto">Egert</p>
]]></description><link>https://forum.netxms.org/post/26285</link><guid isPermaLink="true">https://forum.netxms.org/post/26285</guid><dc:creator><![CDATA[Egert143]]></dc:creator><pubDate>Sun, 18 Aug 2019 10:18:05 GMT</pubDate></item><item><title><![CDATA[Reply to Example of how to setup SSH script/commands? on Thu, 30 May 2019 06:48:55 GMT]]></title><description><![CDATA[<p dir="auto">Yes, but you have to use node object here, not IP address. You can use FindObject or FindNodeObject functions to get object by name.</p>
<p dir="auto">Longer commands are not possible without agent and/or server modifications. Currently there is 1024 character limit on parameter length in AgentRead... functions.</p>
<p dir="auto">I've also created couple of feature requests for SSH improvements:<br />
<a href="https://track.radensolutions.com/issue/NX-1649" rel="nofollow ugc">https://track.radensolutions.com/issue/NX-1649</a><br />
<a href="https://track.radensolutions.com/issue/NX-1650" rel="nofollow ugc">https://track.radensolutions.com/issue/NX-1650</a></p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25812</link><guid isPermaLink="true">https://forum.netxms.org/post/25812</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 30 May 2019 06:48:55 GMT</pubDate></item><item><title><![CDATA[Reply to Example of how to setup SSH script/commands? on Wed, 29 May 2019 11:47:14 GMT]]></title><description><![CDATA[<p dir="auto">Only agent is the NetXMS server itself, so can I just use 127.0.0.1 for the node?<br />
And how about longer commands with multiple lines? I have some custom scripts that are 50 lines long, impossible to put them into a single line</p>
]]></description><link>https://forum.netxms.org/post/25807</link><guid isPermaLink="true">https://forum.netxms.org/post/25807</guid><dc:creator><![CDATA[Millenium7]]></dc:creator><pubDate>Wed, 29 May 2019 11:47:14 GMT</pubDate></item><item><title><![CDATA[Reply to Example of how to setup SSH script/commands? on Wed, 29 May 2019 05:37:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">you can use NXSL script and function AgentReadList like this:</p>
<pre><code>AgentReadList($node, "SSH.Command(mikrotik_ip,login,password,/system package update install)");
</code></pre>
<p dir="auto">where $node is a node with SSH subagent installed. Of course you can use string concatenation to insert proper credentials and device IP address. For example, if variable $node points to NetXMS server node and variable mt to Mikrotik device, you can do</p>
<pre><code>AgentReadList($node, "SSH.Command(" . mt-&gt;ipAddr . ",login,password,/system package update install)");
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25801</link><guid isPermaLink="true">https://forum.netxms.org/post/25801</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 29 May 2019 05:37:51 GMT</pubDate></item></channel></rss>