Here's something you might find useful. I'm running several instances of Node-RED. This flow displays the number of connections to each instance using the exec node
and ss -tn src :port command
This is the flow
[{"id":"02e760e71e4cfd95","type":"group","z":"d63da7d39b03706f","name":"Connections","style":{"fill":"#3f93cf","label":true,"color":"#000000"},"nodes":["c9446a4dbf68dc73","87b499c95dfc64c4","84a0ab1c3b808b5e","1bf01e75855d284a","c92fd42fc96f79dc","4e67396e1882ef72"],"x":34,"y":879,"w":792,"h":142},{"id":"c9446a4dbf68dc73","type":"exec","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Connected","x":390,"y":960,"wires":[["84a0ab1c3b808b5e"],[],[]]},{"id":"87b499c95dfc64c4","type":"inject","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"OS Info","x":95,"y":960,"wires":[["1bf01e75855d284a"]],"l":false},{"id":"84a0ab1c3b808b5e","type":"function","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","name":"Map","func":"\nlet counts =msg.payload.split('\\n')\n// specify the names of the instances\nlet names=[\"Production\",\"Zone 1\",\"Zone 2\",\"Zone 3\",\"Zone 4\",\"Operations\",\"Development\"]\n\nlet stats=[]\nfor(let i=0;i<names.length;i++){\n let stat={\"Name\" :names[i],\"Connections\": parseInt(counts[i])}\n stats.push(stat)\n}\n \n\nmsg.payload=stats\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":920,"wires":[["c92fd42fc96f79dc","4e67396e1882ef72"]]},{"id":"1bf01e75855d284a","type":"function","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","name":"cmd","func":"\n// specify the ports in use\nlet ports=[1880,1881,1882,1885,1886,1887,1888]\nlet cmd=''\nfor(let i=0;i< ports.length;i++){\n cmd +=`ss -tn src :${ports[i]} | wc -l && `\n}\nmsg.payload=cmd.slice(0,-3)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":960,"wires":[["c9446a4dbf68dc73"]]},{"id":"c92fd42fc96f79dc","type":"ui-chart","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","group":"935703926b104cfd","name":"connections","label":"Dashboard Connections","order":1,"chartType":"pie","category":"Connections","categoryType":"str","xAxisLabel":"","xAxisProperty":"Name","xAxisPropertyType":"property","xAxisType":"radial","xAxisFormat":"","xAxisFormatType":"auto","xmin":"","xmax":"","yAxisLabel":"","yAxisProperty":"Connections","yAxisPropertyType":"property","ymin":"","ymax":"","bins":10,"action":"replace","stackSeries":false,"pointShape":"circle","pointRadius":4,"showLegend":true,"removeOlder":1,"removeOlderUnit":"3600","removeOlderPoints":"","colors":["#0095ff","#ff0000","#ff7f0e","#2ca02c","#a347e1","#d62728","#ff9896","#9467bd","#c5b0d5"],"textColor":["#ffffff"],"textColorDefault":false,"gridColor":["#e5e5e5"],"gridColorDefault":true,"width":"6","height":"8","className":"","interpolation":"linear","x":730,"y":940,"wires":[[]]},{"id":"4e67396e1882ef72","type":"debug","z":"d63da7d39b03706f","g":"02e760e71e4cfd95","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":980,"wires":[]},{"id":"935703926b104cfd","type":"ui-group","name":"Connections","page":"40b1bea1d5488e9d","width":6,"height":1,"order":5,"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"}}]