node-red-contrib-ping 1.0.0
Node-RED nodes for grouped and standalone ICMP ping monitors powered by the system ping command.
node-red-contrib-ping
Node-RED contribution nodes for grouped and standalone ICMP ping monitors.
License and AI assistance
This package is original code licensed under the MIT License. It was developed with AI assistance from OpenAI Codex, running the DeepSeek V4 Flash model, and is maintained by lathesky. AI tools are not listed as an author or maintainer.
Installation
After the package is published to npm, install it in your Node-RED user directory:
npm install node-red-contrib-ping
Usage
Ping uses the system ping command (ICMP echo), so targets are host names or
IP addresses rather than ports.
ping-group
Send all targets that should be monitored to the ping-group node in
msg.payload. Each new message replaces the complete active set: the node
stops every previous pinger before starting the new array. Every target pings
immediately, then once per configured interval, and each round emits one
result message.
[
{ "id": "router", "host": "192.168.1.1" },
{ "id": "dns", "host": "8.8.8.8", "timeout": 2000 }
]
Each item requires id and host; timeout (milliseconds) is optional. A
plain string is also accepted as shorthand, with id defaulting to the host.
ids and hosts must be unique within one message.
Result output (msg.event === 'result'):
{ "id": "router", "host": "192.168.1.1", "resolved": "192.168.1.1", "alive": true, "time": 1.2, "ttl": 64, "error": null }
Hosts are resolved before pinging: resolved is the IP address that was
actually pinged. alive is true on a successful reply, time is the
round-trip time in milliseconds, and ttl is the packet time-to-live.
error is one of host not found (DNS name does not exist), DNS lookup failed, timeout, unreachable, no reply, or ping command not available.
ping-standalone
Use ping-standalone for a single pinger that must remain independent of
group updates. It restarts its own pinger for every input, taking one target
in msg.payload; without msg.payload, it uses the node editor settings.
{ "host": "10.0.0.1", "timeout": 3000, "interval": 5000 }
A plain host string is also accepted. timeout and interval (milliseconds)
are optional in the payload. Each round emits one result message with the
same shape as the group output, without the id field.