You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: io/ping/README.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,17 @@ The fix is to allow it as follows
27
27
Usage
28
28
-----
29
29
30
-
Pings a machine and returns the trip time in mS as `msg.payload`.
30
+
Pings 1 or more devices and returns the trip time in mS as `msg.payload`.
31
31
32
32
Returns boolean `false` if no response received, or if the host is unresolveable.
33
33
34
34
`msg.error` will contain any error message if necessary.
35
35
36
36
`msg.topic` contains the ip address of the target host.
37
37
38
-
Default ping is every 20 seconds but can be configured.
38
+
There are 2 modes - `Timed` and `Triggered`.
39
+
40
+
* Timed mode - this is the default mode that pings your devices on a timed basis. Default ping is every 20 seconds but can be configured.
41
+
* Triggered mode - this mode permits you to trigger the ping by an input message. If the `Target` is left blank and `msg.payload` is a string or array, you can ping 1 or more devices on demand.
42
+
43
+
Refer to the built in help on the side-bar info panel for more details.
<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>
11
+
</dl>
12
+
<h3>Details</h3>
13
+
<p>Returns <b>false</b> if no response received, or if the host is unresolveable.</p>
4
14
<p>Default ping is every 20 seconds but can be configured.</p>
<P>In <code>Timed</code> mode, the fields <code>Target</code> and <code>Ping (S)</code> must be populated.</P>
20
+
<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>
21
+
<p><code>Ping (S)</code> is the number of seconds between pings</p>
22
+
</li>
23
+
<li><b>Triggered</b><br>
24
+
<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>
25
+
<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>
26
+
27
+
<p>If <code>Target</code> is left empty, you can pass a CSV string or an array of hosts in `msg.payload`
28
+
<ul>
29
+
<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>
30
+
<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(defaultis5000/5seconds).Additionally,youcanaddwhateverotherpropertiesyouwishtothisobjectandwhenthepingresultisreturned,itwillbepassedtothenextnodein<code>msg.ping</code>forusedownstream</li>
0 commit comments