UPDATE - see this a bit further down
Hi - I had a bit play - you might get something from this...
Result...
The flow...
the code...
[{"id":"222b911b.7f483e","type":"exec","z":"b58d85fb.c44468","command":"ping -n 1","addpay":true,"append":"","useSpawn":"false","timer":"5","oldrc":false,"name":"","x":180,"y":200,"wires":[["6c078f6a.20f33"],["835178d3.275268"],["15d9eea6.b13c31"]]},{"id":"3569dd52.27fd92","type":"inject","z":"b58d85fb.c44468","name":"*** Setup devices to ping here ***","topic":"","payload":"[{\"name\":\"router\",\"ip\":\"192.168.0.1\"},{\"name\":\"tv\",\"ip\":\"192.168.0.51\"},{\"name\":\"smart speaker\",\"ip\":\"192.168.0.52\"},{\"name\":\"bad device\",\"ip\":\"192.168.1.99\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":60,"wires":[["935ef4ca.1414c8"]]},{"id":"935ef4ca.1414c8","type":"split","z":"b58d85fb.c44468","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":390,"y":60,"wires":[["801f89e0.5a45e8"]]},{"id":"6c078f6a.20f33","type":"function","z":"b58d85fb.c44468","name":"update thisPing","func":"\nmsg.thisPing.timestamp = new Date();\nmsg.thisPing.message = msg.payload;\n\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":160,"wires":[["8d1f2fa0.953ce","38217bfa.ebbcd4"]]},{"id":"835178d3.275268","type":"function","z":"b58d85fb.c44468","name":"update thisPing","func":"\nmsg.thisPing.timestamp = new Date();\nmsg.thisPing.message = msg.payload;\nmsg.thisPing.error = true;\nmsg.thisPing.state = 'ng'\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":200,"wires":[["682780dd.070e3","38217bfa.ebbcd4"]]},{"id":"15d9eea6.b13c31","type":"function","z":"b58d85fb.c44468","name":"update thisPing","func":"msg.thisPing.timestamp = new Date();\nmsg.thisPing.result = msg.payload;\nmsg.thisPing.error = msg.payload.code !== 0;\nmsg.thisPing.state = msg.thisPing.error === false ? \"ok\" : \"ng\";\n\n\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":240,"wires":[["705d8927.7a4068","38217bfa.ebbcd4"]]},{"id":"801f89e0.5a45e8","type":"function","z":"b58d85fb.c44468","name":"Init thisPing","func":"let pingResults = flow.get(\"pingResults\") || {}\nmsg.thisPing = pingResults[msg.topic] || {};\n\nmsg.thisPing.name = msg.payload.name;\nmsg.thisPing.ip = msg.payload.ip;\nmsg.thisPing.timestamp = new Date();\nmsg.thisPing.result = '';\nmsg.thisPing.error = null;\nmsg.thisPing.state = 'pinging';\n\nmsg.topic = msg.thisPing.name;\nmsg.payload = msg.thisPing.ip;\n\npingResults[msg.topic] = msg.thisPing;//store ping obj in pingResults\nflow.set(\"pingResults\",pingResults);//save pingResults in flow context\n\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":60,"wires":[["222b911b.7f483e","460bf53.537a60c"]]},{"id":"460bf53.537a60c","type":"debug","z":"b58d85fb.c44468","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":60,"wires":[]},{"id":"8d1f2fa0.953ce","type":"debug","z":"b58d85fb.c44468","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":160,"wires":[]},{"id":"682780dd.070e3","type":"debug","z":"b58d85fb.c44468","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":200,"wires":[]},{"id":"705d8927.7a4068","type":"debug","z":"b58d85fb.c44468","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":240,"wires":[]},{"id":"38217bfa.ebbcd4","type":"function","z":"b58d85fb.c44468","name":"Update flow context","func":"let pingResults = flow.get(\"pingResults\") || {}\nlet thisPing = msg.thisPing;\n\n//store ping item\npingResults[thisPing.name] = thisPing;\n\n//save pingResults in flow context\nflow.set(\"pingResults\",pingResults);\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":300,"wires":[[]]},{"id":"c2440a8c.cf9c38","type":"template","z":"b58d85fb.c44468","name":"build html table","field":"html","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n<table width=\"100%\">\n <tr>\n <th>Name</th>\n <th>IP</th> \n <th>Status</th> \n </tr>\n {{#tableData}}\n <tr class='{{rowclass}}'>\n <td>{{{name}}}</td>\n <td>{{ip}}</td> \n <td>{{{stateInfo}}}</i></td> \n </tr>\n {{/tableData}}\n</table>","x":560,"y":420,"wires":[["81fa405b.5c169","2fdd97a9.33a278"]]},{"id":"81fa405b.5c169","type":"debug","z":"b58d85fb.c44468","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":380,"wires":[]},{"id":"5cb5897e.9faec8","type":"inject","z":"b58d85fb.c44468","name":"","topic":"","payload":"[{\"name\":\"router\",\"ip\":\"192.168.0.1\"},{\"name\":\"tv\",\"ip\":\"192.168.0.51\"},{\"name\":\"smart speaker\",\"ip\":\"192.168.0.52\"},{\"name\":\"bad device\",\"ip\":\"192.168.1.99\"}]","payloadType":"json","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":420,"wires":[["5cef1fce.0085d"]]},{"id":"5cef1fce.0085d","type":"function","z":"b58d85fb.c44468","name":"convert pingResults to array","func":"let pingResults = flow.get(\"pingResults\") || {}\n\nlet tableData = [];\nfor (let k in pingResults) {\n let r = pingResults[k];\n if(r.state == \"ok\"){\n r.rowclass = \"good\";\n r.stateInfo = '<i class=\"fa fa-thumbs-up\" aria-hidden=\"true\"></i> OK'\n } else if(r.state == \"ng\") {\n r.rowclass = \"bad\";\n r.stateInfo = '<i class=\"fa fa-thumbs-down\" aria-hidden=\"true\"></i> NG'\n } else {\n r.rowclass = \"unknown\";\n r.stateInfo = '<i class=\"fa question\" aria-hidden=\"true\"></i> Unknown'\n }\n tableData.push(r);\n}\n\nmsg.tableData = tableData\n\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":420,"wires":[["c2440a8c.cf9c38"]]},{"id":"2fdd97a9.33a278","type":"ui_template","z":"b58d85fb.c44468","group":"94ef3efa.b0b16","name":"","order":3,"width":"6","height":"5","format":"<style>\ntable {\n color: #333;\n font-family: Helvetica, Arial, sans-serif;\n width: 100%;\n border-collapse: collapse;\n border-spacing: 0;\n}\ntd, th {\n border: 1px solid transparent;\n /* No more visible border */\n height: 30px;\n transition: all 0.3s;\n /* Simple transition for hover effect */\n}\nth {\n background: #DFDFDF;\n /* Darken header a bit */\n font-weight: bold;\n}\ntd {\n background: #FAFAFA;\n text-align: center;\n}\n\n/* Cells in even rows (2,4,6...) are one color */\n\ntr:nth-child(even) td {\n background: #F1F1F1;\n}\n\n/* Cells in odd rows (1,3,5...) are another (excludes header cells) */\n\ntr:nth-child(odd) td {\n background: #FEFEFE;\n}\ntr td:hover {\n background: #666;\n color: #FFF;\n}\n\n/* Hover cell effect! */ \n\ntr.good {\n color: green;\n}\n\ntr.bad {\n color: red;\n}\n\ntr.unknown {\n color: orange;\n}\n\n \n</style>\n<div ng-bind-html=\"msg.html\"></div>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":780,"y":420,"wires":[[]]},{"id":"94ef3efa.b0b16","type":"ui_group","z":"","name":"Default","tab":"6cc8c50b.445afc","disp":true,"width":"6","collapse":false},{"id":"6cc8c50b.445afc","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]