Skip to content

Instantly share code, notes, and snippets.

@IT-Berater
Last active September 25, 2020 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IT-Berater/389eb3a87154398dd23006e5c6e6273b to your computer and use it in GitHub Desktop.
Save IT-Berater/389eb3a87154398dd23006e5c6e6273b to your computer and use it in GitHub Desktop.
Server check and Pushover message
[
{
"id": "57f20a8e.da9f5c",
"type": "tab",
"label": "Check Server",
"disabled": false,
"info": ""
},
{
"id": "59b9ce17.305c18",
"type": "group",
"z": "57f20a8e.da9f5c",
"name": "Server Konfiguration",
"style": {
"fill": "#e3f3d3",
"label": true
},
"nodes": [
"4953dc84.0e17f4",
"d57ef994.5fb108"
],
"x": 34,
"y": 99,
"w": 372,
"h": 142
},
{
"id": "4953dc84.0e17f4",
"type": "inject",
"z": "57f20a8e.da9f5c",
"g": "59b9ce17.305c18",
"name": "Täglich um 7 Uhr: Check pi-org",
"props": [
{
"p": "payload"
},
{
"p": "host",
"v": "pi-org",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 07 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "str",
"x": 210,
"y": 140,
"wires": [
[
"68b351bd.d04918"
]
],
"icon": "node-red/timer.svg"
},
{
"id": "68b351bd.d04918",
"type": "conf ping",
"z": "57f20a8e.da9f5c",
"name": "Ping Server",
"host": "",
"timeout": "10",
"requests": "1",
"x": 570,
"y": 180,
"wires": [
[
"94671663.6ebda",
"df795b54.8baf7"
]
],
"outputLabels": [
"ms"
]
},
{
"id": "b8edda1.bc8aea8",
"type": "pushover",
"z": "57f20a8e.da9f5c",
"name": "Meldung per Pushover versenden",
"device": "",
"title": "Ping Meldung",
"priority": 0,
"sound": "echo",
"url": "",
"url_title": "",
"html": false,
"x": 1160,
"y": 260,
"wires": []
},
{
"id": "94671663.6ebda",
"type": "switch",
"z": "57f20a8e.da9f5c",
"name": "Ist der Server offline?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "false"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 600,
"y": 320,
"wires": [
[
"f4a378f6.880978"
],
[
"2befd736.b04af8"
]
],
"outputLabels": [
"ja",
"nein"
]
},
{
"id": "df795b54.8baf7",
"type": "debug",
"z": "57f20a8e.da9f5c",
"name": "Ping Zeit in ms ausgeben",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1130,
"y": 180,
"wires": []
},
{
"id": "f4a378f6.880978",
"type": "function",
"z": "57f20a8e.da9f5c",
"name": "Nachricht erzeugen",
"func": "var nachricht=\"Der Server \" + msg.host +\" ist nicht erreichbar.\";\nmsg.payload = nachricht;\nmsg.topic=nachricht;\n\nnode.status({fill:\"red\",shape:\"ring\",text:nachricht});\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 850,
"y": 260,
"wires": [
[
"b8edda1.bc8aea8"
]
]
},
{
"id": "d57ef994.5fb108",
"type": "inject",
"z": "57f20a8e.da9f5c",
"g": "59b9ce17.305c18",
"name": "Täglich um 7 Uhr: Check wenzlaff.de",
"props": [
{
"p": "payload"
},
{
"p": "host",
"v": "wenzlaff.de",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 07 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "str",
"x": 230,
"y": 200,
"wires": [
[
"68b351bd.d04918"
]
],
"icon": "node-red/timer.svg"
},
{
"id": "30c6ce0b.731daa",
"type": "comment",
"z": "57f20a8e.da9f5c",
"name": "Server mit Ping auf Erreichbarkeit testen und versendet im Fehlerfall eine Pushover Nachricht",
"info": "",
"x": 360,
"y": 40,
"wires": []
},
{
"id": "eebd651f.163b2",
"type": "comment",
"z": "57f20a8e.da9f5c",
"name": "(c) 2020 Thomas Wenzlaff www.wenzlaff.info",
"info": "",
"x": 1110,
"y": 40,
"wires": []
},
{
"id": "9311c782.a93cb",
"type": "debug",
"z": "57f20a8e.da9f5c",
"name": "Ping erfolgreich",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 360,
"wires": []
},
{
"id": "2befd736.b04af8",
"type": "function",
"z": "57f20a8e.da9f5c",
"name": "Nachricht erzeugen",
"func": "var nachricht=\"Der Server \" + msg.host +\" ist in \" + msg.payload + \" ms erreichbar.\";\nmsg.payload = nachricht;\nmsg.topic=nachricht;\n\nnode.status({fill:\"green\",shape:\"ring\",text:nachricht});\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 850,
"y": 360,
"wires": [
[
"9311c782.a93cb"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment