Two Raspberry Pis check each other is online

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.

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

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

1 Like

so here is the flow

[{"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.

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.

1 Like

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