# Monitoring devices

**URL:** https://discourse.nodered.org/t/monitoring-devices/30742
**Category:** Dashboard
**Created:** [26 July 2020 20:14 UTC](https://discourse.nodered.org/t/monitoring-devices/30742 "2020-07-26T20:14:53Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 20:14 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/1 "2020-07-26T20:14:53Z")

</div>

Hello everyone !!

I hope you can help me, I am taking my first steps in the world of noder-red and I am looking forward to making a dashboard for monitoring the IP devices that I have in the offices of my work.  
Basically I have these 4 offices, with their respective devices:

Office 1:

- printer: 192.168.1.11
- pc 1: 192.168.1.12
- pc 2: 192.168.1.13
- pc 3: 192.168.1.14

Office 2:

- printer: 192.168.2.11
- pc 1: 192.168.2.12
- pc 2: 192.168.2.13
- pc 3: 192.168.2.14

Office 3:

- printer: 192.168.3.11
- pc 1: 192.168.3.12
- pc 2: 192.168.3.13
- pc 3: 192.168.3.14

Office 4:

- printer: 192.168.4.11
- pc 1: 192.168.4.12
- pc 2: 192.168.4.13
- pc 3: 192.168.4.14

I started creating the tables with ui\_tables and a function to be able to test and inject simulated data, in this way I could see that everything is going well in the status monitor.  
Here is what I did so far.

```auto
[{"id":"8eb12775.483628","type":"inject","z":"f16e1fbf.b19a8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"ID\":\"01\",\"Oficina\":\"01\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 1\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"02\",\"Oficina\":\"01\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 2\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"03\",\"Oficina\":\"01\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 3\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"04\",\"Oficina\":\"01\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 4\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"05\",\"Oficina\":\"02\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 1\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"06\",\"Oficina\":\"02\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 2\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"07\",\"Oficina\":\"02\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 3\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"08\",\"Oficina\":\"02\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 4\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"09\",\"Oficina\":\"03\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 1\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"10\",\"Oficina\":\"03\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 2\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"11\",\"Oficina\":\"03\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 3\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}, {\"ID\":\"12\",\"Oficina\":\"03\",\"Latencia Print\":\"103\",\"Impresora\":\"ok\",\"PC 4\":\"ok\",\"PC 2\":\"ok\",\"PC 3\":\"ok\"}]","payloadType":"json","x":270,"y":160,"wires":[["5592d69.1974928"]]},{"id":"5592d69.1974928","type":"ui_table","z":"f16e1fbf.b19a8","group":"8b1db693.daf448","name":"","order":4,"width":0,"height":0,"columns":[],"outputs":0,"cts":false,"x":510,"y":160,"wires":[]},{"id":"8b1db693.daf448","type":"ui_group","z":"","name":"Ofiicinas","tab":"ef7098ce.c64e78","order":1,"disp":true,"width":"25","collapse":false},{"id":"ef7098ce.c64e78","type":"ui_tab","z":"","name":"Federico","icon":"track_changes","order":1,"disabled":false,"hidden":false}]

```

The question is that what I would like is to find a way that every 10 seconds a ping is made to each of the hosts and, depending on the answer, to complete the fields in the table.

I don't know if I can make myself understood. Could you give me some help in this regard or at least tell me what path should I take? I searched the internet but I did not find anything similar, I found something at [Monitoring IoT by Ping](https://discourse.nodered.org/t/monitoring-iot-by-ping/23718/28) but it does not work for me.

Thanks everyone for your help!  
Sorry for my English, it is not very good.

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [26 July 2020 20:21 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/2 "2020-07-26T20:21:46Z")

</div>

> [@federicobalm](#):
>
> Office 1:
> 
> - printer: 192.168.1.11
> - pc 1: 192.168.1.11
> - pc 2: 192.168.1.11
> - pc 3: 192.168.1.11
> 
> Office 2:
> 
> - printer: 192.168.2.11
> - pc 1: 192.168.2.11
> - pc 2: 192.168.2.11
> - pc 3: 192.168.2.11
> 
> Office 3:
> 
> - printer: 192.168.3.11
> - pc 1: 192.168.3.11
> - pc 2: 192.168.3.11
> - pc 3: 192.168.3.11
> 
> Office 4:
> 
> - printer: 192.168.4.11
> - pc 1: 192.168.4.11
> - pc 2: 192.168.4.11
> - pc 3: 192.168.4.11

This IP addressing cannot really function at all, you have multiple machines with the same IP address. Have you maybe made a mistake while writting this down?

---

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 20:26 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/3 "2020-07-26T20:26:35Z")

</div>

Sorry !!! .... I did abuse of "copy and paste" and avoid modifying the ip

these are the correct directions

```auto
Office 1:
- printer: 192.168.1.11
- pc 1: 192.168.1.12
- pc 2: 192.168.1.13
- pc 3: 192.168.1.14

Office 2:
- printer: 192.168.2.11
- pc 1: 192.168.2.12
- pc 2: 192.168.2.13
- pc 3: 192.168.2.14

Office 3:
- printer: 192.168.3.11
- pc 1: 192.168.3.12
- pc 2: 192.168.3.13
- pc 3: 192.168.3.14

Office 4:
- printer: 192.168.4.11
- pc 1: 192.168.4.12
- pc 2: 192.168.4.13
- pc 3: 192.168.4.14

```

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [26 July 2020 20:29 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/4 "2020-07-26T20:29:07Z")

</div>

I thought so!  
Your English is fine!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 July 2020 20:31 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/5 "2020-07-26T20:31:25Z")

</div>

> [@federicobalm](#):
>
> I found something at [Monitoring IoT by Ping](https://discourse.nodered.org/t/monitoring-iot-by-ping/23718/28) but it does not work for me.

What doesn't work? Show us a screenshot of your flow and where you enter the IP addresses.

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [26 July 2020 20:32 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/6 "2020-07-26T20:32:31Z")

</div>

Ah, just saw that the flow you wanted to post is missing in your first post!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 July 2020 20:32 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/7 "2020-07-26T20:32:33Z")

</div>

> [@federicobalm](#):
>
> Here is what I did so far.

^ You didn't post anything

---

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 20:52 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/8 "2020-07-26T20:52:54Z")

</div>

I already uploaded it, I had copied the code from only one node. it's OK now

---

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 20:59 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/9 "2020-07-26T20:59:31Z")

</div>

this is the ip:

```auto
[ {"name":"router","host":"192.168.0.1"}, 
{"name":"cel fede","host":"192.168.0.3"}, 
{"name":"chromecast","host":"192.168.0.4"}, 
{"name":"DESKTOP-BU4OE2S","host":"192.168.0.5"}, 
{"name":"desconocido","host":"192.168.0.9"}, 
{"name":"android","host":"192.168.0.11"}, 
{"name":"raspberry","host":"192.168.0.21"}, 
{"name":"DESKTOP-Q5EN2V","host":"192.168.0.38"}, 
{"name":"virtual","host":"192.168.0.13"} ]

```

and here are the screenshots

 ![capura1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee92795231e2d9d2466edc040700e185b993c6cb.png)  
 ![capura2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0eb3b7d7dc24524d9399fc17b1b387802adaef5b.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 July 2020 21:02 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/10 "2020-07-26T21:02:07Z")

</div>

the flow you posted is ...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5018024bb2c889cc090e14138b38afed30da9b55.png)

that is nothing like the screen shot of your flow.

---

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 21:07 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/11 "2020-07-26T21:07:29Z")

</div>

That's right, as what was published in [https://discourse.nodered.org/t/monitoring-iot-by-ping/23718/28](https://discourse.nodered.org/t/monitoring-iot-by-ping/23718/28) did not work, I decided to start from 0 with a new one.

The caption I uploaded is from when I tried the code from [Monitoring IoT by Ping](https://discourse.nodered.org/t/monitoring-iot-by-ping/23718/28).

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 July 2020 21:09 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/12 "2020-07-26T21:09:53Z")

</div>

ok, im lost off with which one you are trying to get working - the flow you posted has no pinging etc.

the flow from the Monitoring IoT thread had a small typo (pretty easy to fix - i'll go edit the post in a second)

here is the fixed version...

```auto
[{"id":"51f7207a.baa53","type":"inject","z":"a878aaaa.79a018","name":" ***Setup devices to ping here***","topic":"","payload":"[{\"name\":\"router\",\"host\":\"192.168.1.1\"},{\"name\":\"tv\",\"host\":\"192.168.1.51\"},{\"name\":\"smart speaker\",\"host\":\"192.168.1.52\"},{\"name\":\"bad device\",\"host\":\"192.168.2.99\"}]","payloadType":"json","repeat":"20","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":260,"wires":[["cf66e372.27656"]]},{"id":"99c8413.a9a79c","type":"template","z":"a878aaaa.79a018","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>Host</th> \n <th>Status</th> \n </tr>\n {{#tableData}}\n <tr class='{{rowclass}}'>\n <td>{{{name}}}</td>\n <td>{{host}}</td> \n <td>{{{stateInfo}}}</i></td> \n </tr>\n {{/tableData}}\n</table>","x":660,"y":320,"wires":[["c9452322.9411d","90592906.29a578"]]},{"id":"c9452322.9411d","type":"debug","z":"a878aaaa.79a018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":360,"wires":[]},{"id":"3988b1f3.69647e","type":"inject","z":"a878aaaa.79a018","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":230,"y":320,"wires":[["4e150f7e.63b67"]]},{"id":"4e150f7e.63b67","type":"function","z":"a878aaaa.79a018","name":"convert pingResults to array","func":"let pingResults = flow.get(\"pingResults\") || {}\nlet now = new Date();\n\nlet tableData = [];\nfor (let k in pingResults) {\n let r = pingResults[k];\n r.age = now - r.timestamp\n if(r.age > 18000){\n r.state = \"old\"\n }\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> ' + r.state\n }\n tableData.push(r);\n}\n\nmsg.tableData = tableData\n\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":320,"wires":[["99c8413.a9a79c","71f260f1.aacbf"]]},{"id":"cf66e372.27656","type":"ping","z":"a878aaaa.79a018","mode":"triggered","name":"","host":"","timer":"20","inputs":1,"x":530,"y":260,"wires":[["ddef4dbb.e8897"]]},{"id":"cf6a929c.6311a","type":"debug","z":"a878aaaa.79a018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":260,"wires":[]},{"id":"ddef4dbb.e8897","type":"function","z":"a878aaaa.79a018","name":"Store Results","func":"let pingResults = flow.get(\"pingResults\") || {}\nlet thisPing = pingResults[msg.topic] || {};\nlet success = msg.payload !== false && msg.payload >= 0;\n\nthisPing.name = msg.ping.name;\nthisPing.host = msg.ping.host;\nthisPing.timestamp = new Date();\nthisPing.responseTime = success ? msg.payload : null;\nthisPing.state = success ? \"ok\" : \"ng\" ;\n\npingResults[msg.topic] = thisPing;//store ping obj in pingResults\nflow.set(\"pingResults\",pingResults);//save pingResults in flow context\n\nmsg.payload = thisPing;\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":260,"wires":[["cf6a929c.6311a"]]},{"id":"90592906.29a578","type":"ui_template","z":"a878aaaa.79a018","group":"3dc35e31.466292","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":840,"y":320,"wires":[[]]},{"id":"71f260f1.aacbf","type":"debug","z":"a878aaaa.79a018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":400,"wires":[]},{"id":"3dc35e31.466292","type":"ui_group","z":"","name":"Default","tab":"5132060d.4cde48","order":1,"disp":true,"width":"6","collapse":false},{"id":"5132060d.4cde48","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![federicobalm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/federicobalm/32/26456_2.png) [@federicobalm](https://discourse.nodered.org/u/federicobalm)
#### Post date: [26 July 2020 21:14 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/13 "2020-07-26T21:14:48Z")

</div>

Ohhh yes now go, my apologies but the truth I could not find the typographical error.

With this arrangement that you made, I will try to continue advancing and I will tell you how I am doing. Thank you!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [25 August 2020 21:14 UTC](https://discourse.nodered.org/t/monitoring-devices/30742/14 "2020-08-25T21:14:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
