1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/io/ping/locales/en-US/88-ping.html
2020-04-03 16:07:41 +01:00

54 lines
3.1 KiB
HTML

<script type="text/html" data-help-name="ping">
<p>Pings a machine and returns the trip time in mS as <code>msg.payload</code>.</p>
<h3>Output</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">number</span></dt>
<dd> the trip time in mS.</dd>
<dt>topic <span class="property-type">string</span></dt>
<dd> the target host/ip</dd>
<dt>ping <span class="property-type">object</span></dt>
<dd> an object containing <code>host</code> and any other properties sent in the array object. <br>NOTE: This object is only appended when using triggered mode and an array for input payload. It is intended for adavanced users and permits scenarios where you need additional properties to be tagged into your result for use downstream.</dd>
</dl>
<h3>Details</h3>
<p>Returns <b>false</b> if no response received, or if the host is unresolveable.</p>
<p>Default ping is every 20 seconds but can be configured.</p>
<h4>Mode...</h4>
<ul>
<li><b>Timed</b><br>
<P>In <code>Timed</code> mode, the fields <code>Target</code> and <code>Ping (S)</code> must be populated.</P>
<p><code>Target</code> must be a CSV list of hosts / IPs e.g. <code>"192.168.0.1"</code> or <code>"192.168.0.1, www.google.com"</code></p>
<p><code>Ping (S)</code> is the number of seconds between pings</p>
</li>
<li><b>Triggered</b><br>
<p>In <code>Triggered</code> mode, you must connect an input wire and pass a <code>msg</code> in to trigger the ping operation.</p>
<p>If <code>Target</code> is populated, this will be used as the host/ip. The Target must be is a CSV list of hosts / IPs e.g. <code>"192.168.0.1"</code> or <code>"192.168.0.1, www.google.com"</code></p>
<p>If <code>Target</code> is left empty, you can pass a CSV string or an array of hosts in `msg.payload`
<ul>
<li><code>string</code> - a CSV list of hosts / IPs e.g. <code>"192.168.0.1"</code> or <code>"192.168.0.1, www.google.com"</code> </li>
<li><code>array</code> - an array of hosts as string or object. NOTE: The object must contain at minimum <code>.host</code>. Optionally, you can add a <code>timeout</code> property between 1000 & 30000 (default is 5000 / 5 seconds). Additionally, you can add whatever other properties you wish to this object and when the ping result is returned, it will be passed to the next node in <code>msg.ping</code> for use downstream</li>
<li>Example array payload input: <pre>[
"192.168.0.99",
{
"host":"192.168.0.1",
"name":"The router"
},
{
"host":"myapiserver.com",
"name":"external API",
"timeout": 20000,
"support":"support@myapiserver.com"
}
]</pre> </li>
</ul>
</p>
</li>
</ul>
<p>Note: if running inside Ubuntu Snap you will need to manually start the network-observe interface.
`snap connect node-red:network-observe`</p>
</script>