For those of you using pm2 to launch and monitor your instances, this flow lets you monitor from within Node-Red
Flow
[{"id":"bfa40032e7b236f5","type":"group","z":"d63da7d39b03706f","name":"Node-Red","style":{"fill":"#7fb7df","label":true,"color":"#000000"},"nodes":["5c732e4feb3baed0","a08d268203b4a005","96c575b95962a468","a30fcfc64ebdd450","18220c4ca4e6f003"],"x":34,"y":739,"w":792,"h":122},{"id":"5c732e4feb3baed0","type":"exec","z":"d63da7d39b03706f","g":"bfa40032e7b236f5","command":"/usr/local/bin/pm2 jlist","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Node Info","x":200,"y":800,"wires":[["a30fcfc64ebdd450"],[],[]]},{"id":"a08d268203b4a005","type":"inject","z":"d63da7d39b03706f","g":"bfa40032e7b236f5","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"OS Info","x":95,"y":800,"wires":[["5c732e4feb3baed0"]],"l":false},{"id":"96c575b95962a468","type":"function","z":"d63da7d39b03706f","g":"bfa40032e7b236f5","name":"Map","func":"const dashboards=msg.payload\nlet props = [];\nconst numberPattern = /\\d{4}/g\n\ndashboards.forEach(dashboard => {\n const d1 = new Date(dashboard.pm2_env.pm_uptime)\n const d2 = new Date();\n const diff = Math.abs(d2.getTime() - d1.getTime())\n const updays = Math.floor(diff / (1000 * 60 * 60 * 24))\n const name = dashboard.name.toUpperCase()\n const path = dashboard.pm2_env.pm_out_log_path\n const port =path.match(numberPattern)[0]\n const mem = (dashboard.monit.memory/ (1024 * 1024)).toFixed(1) + \" MB\"\n const status = dashboard.pm2_env.status=='online' ?'lawngreen':'orange'\n let arr = { \n \"PMID\": dashboard.pm_id ,\n \"NAME\": name,\n \"PORT\": port,\n //\"PID\": dashboard.pid,\n \"UPTIME\": updays+'D',\n \"STATUS\": status,\n \"CPU\": dashboard.monit.cpu +'%',\n \"MEMORY\": mem,\n };\n props.push(arr);\n})\n\nmsg.payload=props\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":820,"wires":[["18220c4ca4e6f003"]]},{"id":"a30fcfc64ebdd450","type":"json","z":"d63da7d39b03706f","g":"bfa40032e7b236f5","name":"","property":"payload","action":"","pretty":false,"x":390,"y":780,"wires":[["96c575b95962a468"]]},{"id":"18220c4ca4e6f003","type":"ui-table","z":"d63da7d39b03706f","g":"bfa40032e7b236f5","group":"1c54b30d7d8e7c7b","name":"Node-RED","label":"DASHBOARD INSTANCES","order":3,"width":0,"height":0,"maxrows":0,"passthru":false,"autocols":false,"showSearch":false,"selectionType":"none","columns":[{"title":"PM ID","key":"PMID","keyType":"key","type":"text","width":"","align":"start"},{"title":"NAME","key":"NAME","keyType":"key","type":"text","width":"","align":"start"},{"title":"PORT","key":"PORT","keyType":"key","type":"text","width":"","align":"start"},{"title":"UPTIME","key":"UPTIME","keyType":"key","type":"text","width":"","align":"start"},{"title":"STATUS","key":"STATUS","keyType":"key","type":"color","width":"","align":"start"},{"title":"CPU","key":"CPU","keyType":"key","type":"progress","width":"","align":"start"},{"title":"MEMORY","key":"MEMORY","keyType":"key","type":"text","width":"","align":"start"}],"mobileBreakpoint":"sm","mobileBreakpointType":"defaults","action":"replace","x":730,"y":780,"wires":[[]]},{"id":"1c54b30d7d8e7c7b","type":"ui-group","name":"Dashboard","page":"40b1bea1d5488e9d","width":"12","height":1,"order":4,"showTitle":false,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"40b1bea1d5488e9d","type":"ui-page","name":"System Status","ui":"4740393b964cb7af","path":"/system","icon":"mdi-cog","layout":"tabs","theme":"11edfaf96d0baec1","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":16,"className":"","visible":"true","disabled":"false"},{"id":"4740393b964cb7af","type":"ui-base","name":"Tiger","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control","ui-dropdown","ui-chart","ui-gauge","ui-button","ui-template","ui-text","ui-table","ui-form"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"fixed","titleBarStyle":"hidden","showReconnectNotification":true,"notificationDisplayTime":"1","showDisconnectNotification":true},{"id":"11edfaf96d0baec1","type":"ui-theme","name":"Dark1","colors":{"surface":"#424242","primary":"#0094ce","bgPage":"#424242","groupBg":"#424242","groupOutline":"#424242"},"sizes":{"density":"default","pagePadding":"2px","groupGap":"6px","groupBorderRadius":"4px","widgetGap":"10px"}}]
Page