{
  "name": "Backup Monitoring",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "id": "backup-check-starten",
      "name": "Backup Check starten",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://example.com/api/backups",
        "sendBody": true,
        "contentType": "json",
        "jsonBody": "={{ $json }}",
        "options": {}
      },
      "id": "backup-liste-laden",
      "name": "Backup Liste laden",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        -100
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://example.com/api/systems",
        "sendBody": true,
        "contentType": "json",
        "jsonBody": "={{ $json }}",
        "options": {}
      },
      "id": "system-inventar-laden",
      "name": "System Inventar laden",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        120
      ]
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "id": "backups-und-systeme-verbinden",
      "name": "Backups und Systeme verbinden",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        520,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "return items.map((item) => ({ json: { ...item.json, ageHours: Number(item.json.ageHours || 26), minSizeMb: 50, sizeMb: Number(item.json.sizeMb || 120) } }));"
      },
      "id": "backup-alter-berechnen",
      "name": "Backup Alter berechnen",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        780,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.ageHours }}",
              "rightValue": 24,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ]
        },
        "options": {}
      },
      "id": "backup-zu-alt",
      "name": "Backup zu alt?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1040,
        -80
      ]
    },
    {
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.sizeMb }}",
              "rightValue": "={{ $json.minSizeMb }}",
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ]
        },
        "options": {}
      },
      "id": "backup-zu-klein",
      "name": "Backup zu klein?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1040,
        130
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channel": "#ops",
        "text": "Backup Check meldet ein Problem im Demo-System."
      },
      "id": "ops-alarm-senden",
      "name": "Ops Alarm senden",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        1300,
        -150
      ]
    },
    {
      "parameters": {
        "fromEmail": "team@example.com",
        "toEmail": "team@example.com",
        "subject": "Backup Monitoring Warnung",
        "html": "<p>Ein Beispiel-Backup ist zu alt oder zu klein.</p>",
        "options": {}
      },
      "id": "owner-per-e-mail-informieren",
      "name": "Owner per E-Mail informieren",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1560,
        -150
      ]
    },
    {
      "parameters": {},
      "id": "backup-ist-ok",
      "name": "Backup ist ok",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1300,
        140
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://example.com/api/monitoring/backups",
        "sendBody": true,
        "contentType": "json",
        "jsonBody": "={\"status\":\"checked\"}",
        "options": {}
      },
      "id": "monitoring-ergebnis-speichern",
      "name": "Monitoring Ergebnis speichern",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        0
      ]
    }
  ],
  "connections": {
    "Backup Check starten": {
      "main": [
        [
          {
            "node": "Backup Liste laden",
            "type": "main",
            "index": 0
          },
          {
            "node": "System Inventar laden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup Liste laden": {
      "main": [
        [
          {
            "node": "Backups und Systeme verbinden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "System Inventar laden": {
      "main": [
        [
          {
            "node": "Backups und Systeme verbinden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backups und Systeme verbinden": {
      "main": [
        [
          {
            "node": "Backup Alter berechnen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup Alter berechnen": {
      "main": [
        [
          {
            "node": "Backup zu alt?",
            "type": "main",
            "index": 0
          },
          {
            "node": "Backup zu klein?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup zu alt?": {
      "main": [
        [
          {
            "node": "Ops Alarm senden",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Backup ist ok",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup zu klein?": {
      "main": [
        [
          {
            "node": "Ops Alarm senden",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Backup ist ok",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ops Alarm senden": {
      "main": [
        [
          {
            "node": "Owner per E-Mail informieren",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Owner per E-Mail informieren": {
      "main": [
        [
          {
            "node": "Monitoring Ergebnis speichern",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup ist ok": {
      "main": [
        [
          {
            "node": "Monitoring Ergebnis speichern",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}
