# Two Raspberry Pis check each other is online

**URL:** https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177
**Category:** General
**Created:** [22 May 2024 19:26 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177 "2024-05-22T19:26:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![daxliniere](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/daxliniere/32/42187_2.png) [@daxliniere](https://discourse.nodered.org/u/daxliniere)
#### Post date: [22 May 2024 19:26 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/1 "2024-05-22T19:26:43Z")

</div>

Hey gang,  
I have an RPi at work and one at home. They're both on a private VPN, so effectively "on the same LAN" (virtually speaking).

I would love a way to have them both check on each other for offline events and send me a (Pushbullet) notification if one is offline?

Anyone got a good idea on how best to do this?

All the best,  
Dax.

---

<div class="post-metadata">

### Author: ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)
#### Post date: [22 May 2024 19:51 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/2 "2024-05-22T19:51:20Z")

</div>

Ping the other machine and if ping is true it's online, not at home but I've got a flow that does this

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 May 2024 20:07 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/3 "2024-05-22T20:07:14Z")

</div>

Do you use MQTT? If so, where are the broker(s)?

---

<div class="post-metadata">

### Author: ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)
#### Post date: [22 May 2024 20:10 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/4 "2024-05-22T20:10:02Z")

</div>

so here is the flow

```auto
[{"id":"89b001c762b80f9b","type":"tab","label":"Ping","disabled":false,"info":"","env":[]},{"id":"9bf394d75d4f5613","type":"ping","z":"89b001c762b80f9b","protocol":"Automatic","mode":"timed","name":"Ping Garage","host":"192.168.5.36","timer":"180","inputs":0,"x":270,"y":140,"wires":[["0e0cc66606f567d1"]]},{"id":"c099467dfa876611","type":"inject","z":"89b001c762b80f9b","name":"true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":250,"y":80,"wires":[["0e0cc66606f567d1"]]},{"id":"f336d63b901d4f6c","type":"inject","z":"89b001c762b80f9b","name":"false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":250,"y":200,"wires":[["0e0cc66606f567d1"]]},{"id":"0e0cc66606f567d1","type":"function","z":"89b001c762b80f9b","name":"Ping True","func":"let Z = msg.payload;\nvar Msg;\n\nif (Z > 0) {\n global.set(\"PingGarage\", true);\n node.status({ fill: \"blue\", shape: \"ring\", text: true });\n return Msg;\n}\n\nglobal.set(\"PingGarage\", false);\nnode.status({ fill: \"blue\", shape: \"ring\", text: false });\n\n\nreturn Msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":140,"wires":[[]]}]

```

What this does is set a global if the ping is true, I then check the global and send an email from another flow.

---

<div class="post-metadata">

### Author: ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)
#### Post date: [22 May 2024 20:12 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/5 "2024-05-22T20:12:48Z")

</div>

I poked around and there is also a flow that pings microsoft to see if the network is up. My internet was notoriously unstable so I collected data on how much it was down to harass my ISP.

---

<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: [20 August 2024 20:13 UTC](https://discourse.nodered.org/t/two-raspberry-pis-check-each-other-is-online/88177/6 "2024-08-20T20:13:31Z")

</div>

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