2014-07-27 19:05:23 +02:00
|
|
|
node-red-node-ping
|
|
|
|
==================
|
|
|
|
|
2016-02-12 14:14:12 +01:00
|
|
|
A <a href="http://nodered.org" target="_new">Node-RED</a> node to ping a
|
|
|
|
remote server, for use as a keep-alive check.
|
2014-07-27 19:05:23 +02:00
|
|
|
|
|
|
|
Install
|
|
|
|
-------
|
|
|
|
|
|
|
|
Run the following command in the root directory of your Node-RED install
|
|
|
|
|
|
|
|
npm install node-red-node-ping
|
|
|
|
|
2016-01-09 17:56:46 +01:00
|
|
|
**Gotcha**
|
|
|
|
|
|
|
|
On some versions on Raspbian (Raspberry Pi) `ping` seems to be a root only command.
|
|
|
|
The fix is to allow it as follows
|
|
|
|
|
|
|
|
sudo setcap cap_net_raw=ep /bin/ping
|
|
|
|
sudo setcap cap_net_raw=ep /bin/ping6
|
|
|
|
|
2014-07-27 19:05:23 +02:00
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
2016-02-13 12:15:02 +01:00
|
|
|
Pings a machine and returns the trip time in mS as `msg.payload`.
|
2016-02-12 14:14:12 +01:00
|
|
|
|
|
|
|
Returns boolean `false` if no response received, or if the host is unresolveable.
|
2016-02-13 12:15:02 +01:00
|
|
|
`msg.error` will contain any error message if necessary.
|
2014-07-27 19:05:23 +02:00
|
|
|
|
2016-02-13 12:15:02 +01:00
|
|
|
`msg.topic` contains the ip address of the target host.
|
2014-07-27 19:05:23 +02:00
|
|
|
|
|
|
|
Default ping is every 20 seconds but can be configured.
|