NodeRed-uso cpu y memoria.

El flujo permite conocer el uso de cpu y memoria por parte de Node Red, y hacer un regitro de 24 hs. Se utiliza el comando linux "ps".

This is an image

[{"id":"c0706578d54a8782","type":"exec","z":"aee3fb8cfd2b4bcd","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":410,"y":260,"wires":[["34d491363e434072"],[],[]]},{"id":"7eab83348b3e97f1","type":"function","z":"aee3fb8cfd2b4bcd","name":"ps aux","func":"msg.payload = \"ps axo pcpu,pmem,comm | grep node\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":250,"y":180,"wires":[["c0706578d54a8782"]]},{"id":"5505bd6dece637b6","type":"ui_gauge","z":"aee3fb8cfd2b4bcd","name":"","group":"b4ef605f.7699b","order":1,"width":3,"height":3,"gtype":"gage","title":"   Node Red uso Cpu","label":"%","format":"{{msg.cpu}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":790,"y":180,"wires":[]},{"id":"1c233acdb1c98108","type":"ui_gauge","z":"aee3fb8cfd2b4bcd","name":"","group":"b4ef605f.7699b","order":2,"width":3,"height":3,"gtype":"gage","title":"Node Red uso Mem","label":"%","format":"{{msg.mem}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":800,"y":300,"wires":[]},{"id":"34d491363e434072","type":"function","z":"aee3fb8cfd2b4bcd","name":"uso node red","func":"node.status(msg.payload);\nvar arr = msg.payload.split(' ');\nmsg.topic = \"node_red_cpu\";\nmsg.cpu = arr[1];\nmsg.payload = arr[1];\nnode.send(msg);\nmsg.topic = \"node_red_mem\";\nmsg.mem = arr[2];\nmsg.payload = arr[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":240,"wires":[["5505bd6dece637b6","3ab864c6723b6b15","1c233acdb1c98108"]]},{"id":"3ab864c6723b6b15","type":"ui_chart","z":"aee3fb8cfd2b4bcd","name":"","group":"b4ef605f.7699b","order":3,"width":6,"height":4,"label":"uso cpu mem","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"node_red_cpu,node_red_mem","dot":false,"ymin":"0","ymax":"50","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#e60a0a","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":790,"y":240,"wires":[[]]},{"id":"5fd0039701e8d5d2","type":"inject","z":"aee3fb8cfd2b4bcd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":260,"wires":[["7eab83348b3e97f1"]]},{"id":"3abeafeb67c0ddac","type":"comment","z":"aee3fb8cfd2b4bcd","name":"Node Red - uso cpu y memoria","info":"","x":500,"y":120,"wires":[]},{"id":"b4ef605f.7699b","type":"ui_group","name":"uso cpu","tab":"1ad18e6096b4d48c","order":1,"disp":true,"width":"6","collapse":true,"className":""},{"id":"1ad18e6096b4d48c","type":"ui_tab","name":"Node Red","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

Created 2 years, 9 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • exec (x1)
  • function (x2)
  • inject (x1)
Other
  • ui_chart (x1)
  • ui_gauge (x2)
  • ui_group (x1)
  • ui_tab (x1)

Tags

  • exec
  • function
  • gauge
  • chart
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option