For the fun of it.
The one I posted works on both.
THOUGH: BOOKWORM -- can't say.
Yours doesn't work.
ERROR 123 on the nodered last restarted
node.
For the fun of it.
The one I posted works on both.
THOUGH: BOOKWORM -- can't say.
Yours doesn't work.
ERROR 123 on the nodered last restarted
node.
We are going off at a bit of a tangent here but at least you will have relevant info to hand next time someone asks for it
Much simpler (on the surface) flow, it works in Debian, would be interested to see if it's OK on Ubuntu ?
[{"id":"e5c2ee066e9fbfc6","type":"inject","z":"32bc1133.9bf706","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"OS Info","x":1205,"y":2460,"wires":[["f8c36499d7f2a52c"]],"l":false},{"id":"f8c36499d7f2a52c","type":"exec","z":"32bc1133.9bf706","command":"node-red --version && cat /etc/os-release | grep -oP '^PRETTY_NAME=\"\\K.*?(?=\")' && stat -c %y /lost+found | cut -d'.' -f1 | xargs -I {} date -d \"{}\" -Iseconds && uptime -s | xargs -I {} date -d \"{}\" -Iseconds && npm --version && systemctl show nodered | grep '^ExecMainStartTimestamp=' | cut -d'=' -f2- | xargs -I {} date -d \"{}\" -Iseconds","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Get OS Name & last reboot","x":1370,"y":2460,"wires":[["08df6dd7f4c7475b"],[],[]]},{"id":"08df6dd7f4c7475b","type":"function","z":"32bc1133.9bf706","name":"","func":"const line = msg.payload.split('\\n');\n\nmsg.payload = {\n nodered_version: line[0].split(\"v\")[1],\n nodejs_version: line[1].split(\"v\")[1],\n npm_version: line[6],\n nr_started: line[7],\n\n // System info\n hostname: os.hostname(),\n os_pretty: line[3],\n release: `${os.type()} ${os.release()} ${os.arch()} ${os.endianness()}`,\n os_installed: line[4],\n last_reboot: line[5],\n\n // CPU info\n cpu: os.cpus()[0].model,\n cores: os.cpus().length,\n\n // Memory info\n totalmem: (os.totalmem() / (1024 ** 3)).toFixed(1) + \" GB\",\n freemem: (() => {\n const freeMem = os.freemem();\n const gb = freeMem / (1024 * 1024 * 1024);\n return gb >= 1 ? `${gb.toFixed(1)} GB` : `${Math.round(freeMem / (1024 * 1024))} MB`;\n })(),\n\n // Load average\n loadAverage: (() => {\n const [load1min, load5min, load15min] = os.loadavg();\n return {\n load1min: Number(load1min.toFixed(2)),\n load5min: Number(load5min.toFixed(2)),\n load15min: Number(load15min.toFixed(2))\n };\n })(),\n\n // Network interfaces\n networkInterfaces: os.networkInterfaces(),\n\n // Add timestamp of when this data was collected\n collected_at: new Date().toISOString()\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[{"var":"os","module":"os"}],"x":1545,"y":2460,"wires":[["e369c7b8dfd5743d"]],"l":false},{"id":"e369c7b8dfd5743d","type":"debug","z":"32bc1133.9bf706","name":"info","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1660,"y":2460,"wires":[]}]
Ubuntu output:
nodered_version: "4.0.9"
nodejs_version: "20.19.2"
npm_version: "10.8.2"
nr_started: "2025-06-11T07:40:14+10:00"
hostname: "me-desktop"
os_pretty: "Ubuntu 22.04.5 LTS"
release: "Linux 5.15.0-141-generic x64 LE"
os_installed: "2017-10-31T15:42:16+11:00"
last_reboot: "2025-06-11T07:40:07+10:00"
cpu: "Intel(R) Core(TM) i5-7260U CPU @ 2.20GHz"
cores: 4
totalmem: "31.2 GB"
freemem: "12.7 GB"
loadAverage: object
networkInterfaces: object
collected_at: "2025-06-11T01:13:14.437Z"
Looking good!
(Maybe you should upload this to the .... library as a node to use to get system information when posting problems.)
I'm sure a lot of people would appreciate it.
Done -
Good on your Steve.
I really think that WILL be appreciated.
It's Sean BTW - Steve is Captain Pickard, not Data !
I am sorry. I am SHOCKING with names.
Even though if I click on the icon it would probably tell me.
(Phew... It doesn't)
And as you said: We should probably stop nattering on here.
Oops! I forgot that as well. I have specific sudo commands allowed to run by the node-red user without a password and that is one of them.
No problems.
Did you see the flow uploaded by Sean for getting system information?
Yes, saw that thanks. Probably better than mine.
Mine has been working for me for a long time though and is linked into other notifications so I'm going to keep mine. Glad it triggered some useful discussion though.
On RPiOS at least you don't need sudo for systemctl status or systemctl show nodered.
$ systemctl show nodered | grep -oP 'ExecMainStartTimestamp=\K.*' | xargs -0 date -Iseconds -u -d
2025-06-11T10:02:01+00:00