{"id":14753,"library":"node-red-node-ping","title":"Node-RED Ping Node","description":"The `node-red-node-ping` package provides a specialized Node-RED node designed to perform ICMP pings against remote servers. It serves as a network health monitoring and keep-alive check utility within the Node-RED low-code development environment. The node can operate in two primary modes: 'Timed' for periodic checks at configurable intervals, and 'Triggered' for on-demand pings initiated by an input message. Upon execution, it outputs the round-trip time in milliseconds as `msg.payload`, or `false` if the host is unreachable or unresolvable. Error messages are provided in `msg.error` and the target IP in `msg.topic`. The current stable version is 0.3.3, which was last published approximately four years ago, indicating a very slow or ceased release cadence for this specific package. Its primary differentiator is its seamless integration into Node-RED flows, allowing developers to visually incorporate ping functionality without writing custom code, unlike standalone `ping` npm libraries.","status":"maintenance","version":"0.3.3","language":"javascript","source_language":"en","source_url":"https://github.com/node-red/node-red-nodes","tags":["javascript","node-red","ping","keepalive"],"install":[{"cmd":"npm install node-red-node-ping","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-node-ping","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-node-ping","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"npm install node-red-node-ping\n\n# After installation, open your Node-RED editor (usually at http://localhost:1880/).\n# The 'ping' node will appear in the palette under the 'network' category.\n# Drag and drop the 'ping' node onto your flow canvas.\n# Double-click the node to configure its properties, such as the target host(s)\n# and operating mode (Timed or Triggered). Wire an 'inject' node to trigger\n# pings in 'Triggered' mode, or a 'debug' node to view the output message.","lang":"bash","description":"This demonstrates how to install the Node-RED ping node via npm and describes its basic usage within the Node-RED editor."},"warnings":[{"fix":"Manually connect the `network-observe` interface using `sudo snap connect node-red:network-observe` to grant necessary permissions.","message":"When running Node-RED within Ubuntu Snap containers, strict confinement rules may prevent the 'ping' command from accessing external networks.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Elevate permissions for the `ping` and `ping6` executables using `sudo setcap cap_net_raw=ep /bin/ping` and `sudo setcap cap_net_raw=ep /bin/ping6`.","message":"On certain versions of Raspbian (Raspberry Pi OS), the underlying `ping` command may require root privileges to execute, causing the Node-RED node to fail.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `iputils-ping` (or equivalent package for your OS) is installed. On Debian/Ubuntu: `sudo apt-get install iputils-ping`.","cause":"The underlying 'ping' utility is not installed or not in the system's PATH.","error":"Error: ping: command not found"},{"fix":"Refer to the package's 'Gotchas' warnings. For Ubuntu Snap, use `sudo snap connect node-red:network-observe`. For Raspbian, use `sudo setcap cap_net_raw=ep /bin/ping` and `sudo setcap cap_net_raw=ep /bin/ping6`.","cause":"The 'ping' command lacks the necessary network raw socket permissions, often due to strict container environments (like Ubuntu Snap) or system-level security configurations (like on Raspbian).","error":"Error: Operation not permitted"}],"ecosystem":"npm"}