Registry / observability / node-red-contrib-device-stats

node-red-contrib-device-stats

JSON →
library1.1.2jsnpmunverified

node-red-contrib-device-stats provides a Node-RED node designed to capture and emit various operating system statistics within a Node-RED flow. It collects data such as CPU usage, memory consumption, network statistics, and system load average, embedding this information into `msg.payload` for further processing. The current stable version is 1.1.2. Releases appear to be infrequent, primarily addressing bug fixes and dependency updates, with notable changes like migrating build systems (Grunt to Gulp) in version 1.1.0. A key differentiator is its seamless integration into Node-RED's visual programming paradigm, allowing users to trigger statistic collection based on incoming messages. However, it is explicitly limited to Linux and macOS environments, making it unsuitable for Windows deployments. The node requires an incoming message to its input port to trigger data collection, it does not poll automatically.

npm install node-red-contrib-device-stats
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-D
N
node-red-contrib-device-stats
observabilityjavascriptv1.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Node-RED Node Installation
cd ~/.node-red npm install node-red-contrib-device-stats
import { DeviceStatsNode } from 'node-red-contrib-device-stats';
This package provides a Node-RED node, not a traditional JavaScript library. Functionality is accessed via the Node-RED editor palette after installation, not through direct JS imports.
Device Statistics Node Usage
Drag 'Device Statistics' node from the palette into your Node-RED flow.
Once installed, the 'Device Statistics' node will appear in the Node-RED editor palette. It is configured through its properties dialog after being placed on the canvas.
Output Message Payload
msg.payload
msg.stats; msg.deviceStats
The node places all collected statistics directly into the `msg.payload` property of the output message. The structure of the payload depends on the options configured within the node.

Installs the Node-RED package and demonstrates a basic flow to capture system statistics every 3 seconds, displaying them in the debug sidebar.

// To install the Node-RED package: // cd ~/.node-red // npm install node-red-contrib-device-stats // Once installed and Node-RED is restarted, follow these steps in the Node-RED editor: // 1. Open your Node-RED editor (e.g., http://localhost:1880). // 2. Drag an 'Inject' node onto the canvas. // - Configure it to repeat every 3 seconds. // - Set 'Payload' to 'timestamp'. // 3. Drag a 'Device Statistics' node onto the canvas. // - Connect the 'Inject' node's output to the 'Device Statistics' node's input. // - Double-click the 'Device Statistics' node to configure it: // - Enable desired statistics (e.g., CPU, Memory, Network). // - Ensure 'Output' is set to 'msg.payload'. // 4. Drag a 'Debug' node onto the canvas. // - Connect the 'Device Statistics' node's output to the 'Debug' node's input. // - Configure the 'Debug' node to output 'complete msg object' or 'msg.payload'. // 5. Deploy the flow. // 6. Observe system statistics appearing in the debug sidebar every 3 seconds.
Debug
Known issues
gotchaThis node is compatible only with Linux and MacOS operating systems. Deploying or running Node-RED with this node on Windows will result in non-functional behavior or errors, as it relies on OS-specific commands not available on Windows.
fix
Ensure the Node-RED environment where this package is installed and run is either Linux or MacOS.
affects: >=1.0.0
gotchaThe 'Device Statistics' node requires an incoming message to its input port to trigger statistics collection. It does not automatically poll or generate data without an external trigger.
fix
Connect an 'Inject' node (configured for periodic output) or another message-generating node to the input of the 'Device Statistics' node to initiate data collection.
affects: >=1.0.0
breakingPrior to version 1.1.0, the node experienced issues with 'device stats not working with HTTP', potentially leading to incomplete or incorrect network statistics, especially concerning HTTP-related traffic.
fix
Upgrade to version 1.1.0 or newer to resolve HTTP-related statistics collection problems. Run `npm install node-red-contrib-device-stats@latest` in your Node-RED user directory (`~/.node-red`).
affects: <1.1.0
gotchaThe node's output places all collected statistics directly into `msg.payload`. If the incoming message already has important data in `msg.payload`, it will be overwritten by the device statistics.
fix
If you need to preserve original `msg.payload` content, move it to a different message property (e.g., `msg.originalPayload`) before the message reaches the 'Device Statistics' node.
affects: >=1.0.0
Errors
Common errors & fixes
Device stats not working with HTTP
A bug in versions prior to 1.1.0 caused network statistics related to HTTP traffic to be improperly collected or reported.
fix
Upgrade `node-red-contrib-device-stats` to version 1.1.0 or later: `cd ~/.node-red && npm install node-red-contrib-device-stats@latest`.
Node 'Device Statistics' not appearing in Node-RED palette after installation.
The package was not installed correctly in the Node-RED user directory, or Node-RED was not restarted after the installation.
fix
Ensure you are in your Node-RED user directory (typically `~/.node-red`), then run `npm install node-red-contrib-device-stats`. After installation, restart Node-RED (e.g., `node-red-stop && node-red`).
No output from 'Device Statistics' node in debug sidebar, even with an input message.
The node is running on an unsupported operating system (e.g., Windows), or it is incorrectly configured to collect statistics that are not available on the current OS.
fix
Verify that your Node-RED instance is running on Linux or MacOS. Check the node's configuration to ensure that the selected statistics are applicable to your operating system.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
node-red-contrib-device-stats — npm install node-red-contrib-device-stats · libregistry