<?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[scripting ping from a router / firewall to test endpoint]]></title><description><![CDATA[<p dir="auto">I have been reading up on scripting with SSH and NETXMS and various items about NXSL without much success.</p>
<p dir="auto">I believe what I want to do is fairly simple but I don't understand how to implement it in NetXMS.</p>
<p dir="auto">I monitor many Unifi Edgerouters with NetXMS, some of these firewalls have VPN's to remote subnets / devices that I would like to confirm the state of the VPN as up or down.  One way to do this is to ping a device on the other end of the VPN that also has the benefit of causing traffic to keep the VPN's up.  Since the Edgerouters do not have a NetXMS agent installed I don't know how to implement a script from the device like I do with other agents.  I believe it should be just an SSH script but I don't know how to get NetXMS to fire the script and record the output.</p>
<p dir="auto">Basically I want to be able to run an SSH script on a non agent device to ping or other functions and return information.  I would also like to do this on a schedule if possible or during polling.</p>
<p dir="auto">Any ideas on how to implement this?</p>
]]></description><link>https://forum.netxms.org/topic/6908/scripting-ping-from-a-router-firewall-to-test-endpoint</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 06:06:56 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6908.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Feb 2021 16:04:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 21:48:37 GMT]]></title><description><![CDATA[<p dir="auto">Update, for anyone trying to do anything similar, I believe I have a working solution.  I was able create a polled DCI parameter from a Windows Agent using the SSH.nsm subagent to access a router / firewall and then run a script from that device ( in my case Edgerouter ).  Below is how I setup the DCI properties on the Windows Agent System:</p>
<p dir="auto">Data - Parameter:<br />
SSH.Command(192.168.239.1,username, password,sudo /config/scripts/polling_script.sh)</p>
<p dir="auto">Origin:<br />
NetXMS Agent <br />
   ( this differs from information online that says it should be "SSH", I could not get this to work )</p>
<p dir="auto">Data Type:<br />
String</p>
<p dir="auto">Source Node:<br />
Pointing at the Same windows Agent</p>
<p dir="auto">I run a script that is found on the remote router / firewall that consist of a ping command that is parsed for information on if the ping is successful and returns either "OK" or "Failed"</p>
<p dir="auto">my script is similar to this:<br />
if ping -q -c 1 10.200.200.112 2&gt;&amp;1 &gt; /dev/null ; then<br />
    echo "Ok"<br />
else<br />
    echo "Fail"<br />
fi</p>
<p dir="auto">Thank you all for your help, this will allow me to confirm the status of VPN's that I do not control any remote devices, that only allow certain IP's to ping them.</p>
]]></description><link>https://forum.netxms.org/post/29517</link><guid isPermaLink="true">https://forum.netxms.org/post/29517</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Mon, 15 Feb 2021 21:48:37 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 21:39:42 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your input Zebbie, I figured once I got any info other than &lt;&lt;error&gt;&gt; on the DCI parameter then I would begin the process of parsing the data as you recommend.</p>
]]></description><link>https://forum.netxms.org/post/29516</link><guid isPermaLink="true">https://forum.netxms.org/post/29516</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Mon, 15 Feb 2021 21:39:42 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 20:10:08 GMT]]></title><description><![CDATA[<p dir="auto">If the system you're doing the ping on is something like Linux, then &quot;ping&quot; never actually stops to give output with it's default commandline.  You'll want whatever you run through the SSH subagent to return a final value/string that you can deal with.</p>
<p dir="auto">For instance, on Linux, a better ping command would be something like:</p>
<p dir="auto">ping -qc1 192.168.240.1</p>
<p dir="auto">And then parse it with awk or grep to give you a single line output.  There are some good ideas in this thread:</p>
<p dir="auto"><div class="card col-md-9 col-lg-6 position-relative link-preview p-0">

<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="https://unix.stackexchange.com/questions/409203/ping-show-only-results">
Just a moment...
</a>
</h5>
<p class="card-text line-clamp-3"></p>
</div>
<a href="https://unix.stackexchange.com/questions/409203/ping-show-only-results" class="card-footer text-body-secondary small d-flex gap-2 align-items-center lh-2">



<img src="https://unix.stackexchange.com/favicon.ico" alt="favicon" class="not-responsive overflow-hiddden" style="max-width: 21px; max-height: 21px;" onerror="this.remove()"/>



<p class="d-inline-block text-truncate mb-0"> <span class="text-secondary">(unix.stackexchange.com)</span></p>
</a>
</div></p>
<p dir="auto">-zeb</p>
]]></description><link>https://forum.netxms.org/post/29515</link><guid isPermaLink="true">https://forum.netxms.org/post/29515</guid><dc:creator><![CDATA[Zebble]]></dc:creator><pubDate>Mon, 15 Feb 2021 20:10:08 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 15:57:15 GMT]]></title><description><![CDATA[<p dir="auto">Ok, I beleive I am making progress.</p>
<p dir="auto">I have created a DCI parameter on a test PC - windows 10 running NetXMS agent with SSH.nsm subagent.</p>
<p dir="auto">I have created a DCI parameter as follows:<br />
Parameter:<br />
   SSH.Command(192.168.239.1,username,password,ping 192.168.240.1)</p>
<p dir="auto">Origin:<br />
   NetXMS agent</p>
<p dir="auto">Data Type:<br />
   String</p>
<p dir="auto">I have tried using the origin of SSH but I never get anything back. </p>
<p dir="auto">With the above settings I now see this in the log:</p>
<p dir="auto">2021.02.15 08:51:45.001 *D* [comm.cs.2          ] Requesting parameter "SSH.Command(192.168.239.1,username,password,ping 192.168.240.1)"<br />
2021.02.15 08:51:46.157 *D* [                   ] SSH: created new session keystone@192.168.239.1:22/2</p>
<p dir="auto">So I am presumably getting a return of "created new session..."</p>
<p dir="auto">How can I use this to SSH into my device, and ping another device and return the result of "successful" or "failed"?????</p>
<p dir="auto">Thank you all for your assistance.</p>
]]></description><link>https://forum.netxms.org/post/29514</link><guid isPermaLink="true">https://forum.netxms.org/post/29514</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Mon, 15 Feb 2021 15:57:15 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 15:37:10 GMT]]></title><description><![CDATA[<p dir="auto">I have continued testing with the log verbose setting to 6.  In the Agent log, that is a windows 10 system that I am attempting to use an ssh DCI parameter, the agent log does say that the SSH sub agent is loaded successfully, however the DCI parameter is never mentioned in the log.  I have other custom DCI parameters on this test machine and they do show up in the log.</p>
]]></description><link>https://forum.netxms.org/post/29513</link><guid isPermaLink="true">https://forum.netxms.org/post/29513</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Mon, 15 Feb 2021 15:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 15:20:07 GMT]]></title><description><![CDATA[<p dir="auto">Thank you Victor, I will do that and review, but if you could explain to me in simple terms exactly where these items should be configured.  I presume the DCI parameter should be created on the agent PC node, not the router in question?  I am confused as to where each of these items should actually be created.</p>
]]></description><link>https://forum.netxms.org/post/29512</link><guid isPermaLink="true">https://forum.netxms.org/post/29512</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Mon, 15 Feb 2021 15:20:07 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Mon, 15 Feb 2021 08:17:08 GMT]]></title><description><![CDATA[<p dir="auto">Set debug level on agent to 6 and check agent's log for SSH related messages.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/29501</link><guid isPermaLink="true">https://forum.netxms.org/post/29501</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 15 Feb 2021 08:17:08 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Fri, 12 Feb 2021 18:11:06 GMT]]></title><description><![CDATA[<p dir="auto">I have attempted to create a DCI for a given node using only the "uname -a" under the DCI parameter.  I have the Origin set to SSH, and the Data Type to String. This is to attempt to get anything back in the DCI value.</p>
<p dir="auto">I have attempted entering the NetXMS server and a windows 10 system running with NetXMS agent with the ssh.nsm enabled.  I have also attempted setting the windows 10 system as the SSH proxy, nether of these configurations work.</p>
<p dir="auto">The only information that I get is an &lt;&lt;error&gt;&gt; in the value of the DCI when I force a DCI poll or just wait.</p>
<p dir="auto">Obviously I am missing something or doing something wrong, can you assist further?</p>
]]></description><link>https://forum.netxms.org/post/29483</link><guid isPermaLink="true">https://forum.netxms.org/post/29483</guid><dc:creator><![CDATA[curruscanis]]></dc:creator><pubDate>Fri, 12 Feb 2021 18:11:06 GMT</pubDate></item><item><title><![CDATA[Reply to scripting ping from a router / firewall to test endpoint on Fri, 12 Feb 2021 14:17:01 GMT]]></title><description><![CDATA[<p dir="auto">The basic approach is data collection via SSH - you just create a DCI with SSH origin, its running a command on the remote system and saves first line of output as DCI value.<br />
<a href="https://www.netxms.org/documentation/adminguide/ssh-monitoring.html" rel="nofollow ugc">https://www.netxms.org/documentation/adminguide/ssh-monitoring.html</a></p>
<p dir="auto">Please inform, if this suits your needs.</p>
]]></description><link>https://forum.netxms.org/post/29477</link><guid isPermaLink="true">https://forum.netxms.org/post/29477</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Fri, 12 Feb 2021 14:17:01 GMT</pubDate></item></channel></rss>