[
{
“id”: “ping_inject”,
“type”: “inject”,
“z”: “your_flow_id”,
“name”: “Check Internet”,
“props”: ,
“repeat”: “10”,
“crontab”: “”,
“once”: true,
“onceDelay”: “1”,
“topic”: “”,
“x”: 200,
“y”: 100,
“wires”: [[“ping_exec”]]
},
{
“id”: “ping_exec”,
“type”: “exec”,
“z”: “your_flow_id”,
“command”: “ping -c 1 8.8.8.8”,
“addpay”: false,
“append”: “”,
“useSpawn”: false,
“timer”: “”,
“oldrc”: false,
“name”: “Ping Google”,
“x”: 400,
“y”: 100,
“wires”: [[“ping_switch”], , ]
},
{
“id”: “ping_switch”,
“type”: “switch”,
“z”: “your_flow_id”,
“name”: “Check Ping Success”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “regex”,
“v”: “1 received”,
“vt”: “str”,
“case”: false
},
{
“t”: “else”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 2,
“x”: 600,
“y”: 100,
“wires”: [[“debug_success”] ,[“debug_fail”]]
},
{
“id”: “debug_success”,
“type”: “debug”,
“z”: “your_flow_id”,
“name”: “Internet OK”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 800,
“y”: 60,
“wires”:
},
{
“id”: “debug_fail”,
“type”: “debug”,
“z”: “your_flow_id”,
“name”: “Internet Down”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 800,
“y”: 140,
“wires”:
}
]