{
  "name": "Pinapp Monitoring 24/7",
  "meta": {
    "description": "Importer dans n8n. Configurer credentials Telegram (Bot + Chat ID). Renseigner TELEGRAM_CHAT_ID dans les n\u0153uds ou via credentials. V\u00e9rifications : accueil + sitemap. Compl\u00e9ter avec UptimeRobot (gratuit) en filet externe."
  },
  "nodes": [
    {
      "id": "cron-5",
      "name": "Cron 5min",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 5
            }
          ]
        }
      }
    },
    {
      "id": "http-home",
      "name": "Check Homepage",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        260,
        0
      ],
      "parameters": {
        "url": "https://pinapp.fr/",
        "method": "HEAD",
        "options": {
          "timeout": 5000
        }
      }
    },
    {
      "id": "if-home",
      "name": "If home not 200",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        520,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "a",
              "leftValue": "={{ $json.statusCode }}",
              "rightValue": 200,
              "operator": {
                "type": "number",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        }
      }
    },
    {
      "id": "tg-home-down",
      "name": "Telegram HOME down",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        780,
        -160
      ],
      "parameters": {
        "operation": "sendMessage",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "text": "=\ud83d\udea8 PINAPP DOWN \u2014 homepage\nStatus: {{ $json.statusCode }}\nHeure: {{ $now.toFormat('HH:mm') }}\nhttps://pinapp.fr/"
      }
    },
    {
      "id": "http-sitemap",
      "name": "Check sitemap",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        780,
        120
      ],
      "parameters": {
        "url": "https://pinapp.fr/sitemap.xml",
        "method": "GET",
        "options": {
          "timeout": 8000
        }
      }
    },
    {
      "id": "if-sitemap",
      "name": "If sitemap not 200",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1040,
        120
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "b",
              "leftValue": "={{ $json.statusCode }}",
              "rightValue": 200,
              "operator": {
                "type": "number",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        }
      }
    },
    {
      "id": "tg-sitemap-down",
      "name": "Telegram SITEMAP down",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        1300,
        40
      ],
      "parameters": {
        "operation": "sendMessage",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "text": "=\ud83d\udea8 PINAPP DOWN \u2014 sitemap.xml\nStatus: {{ $json.statusCode }}\nHeure: {{ $now.toFormat('HH:mm') }}"
      }
    },
    {
      "id": "noop-ok",
      "name": "OK",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1300,
        200
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "Cron 5min": {
      "main": [
        [
          {
            "node": "Check Homepage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Homepage": {
      "main": [
        [
          {
            "node": "If home not 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If home not 200": {
      "main": [
        [
          {
            "node": "Telegram HOME down",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check sitemap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check sitemap": {
      "main": [
        [
          {
            "node": "If sitemap not 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If sitemap not 200": {
      "main": [
        [
          {
            "node": "Telegram SITEMAP down",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}