> For the complete documentation index, see [llms.txt](https://academy.cegedim.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.cegedim.cloud/monitoring/custom-check/custom-check-get-started.md).

# Custom check - Get started

## How to create a Custom Check?

Go to **ITCare → Resources → URLs → Actions → Add Custom Check**

Both Custom Check and External Custom Check share the same interface. For the complete field reference, see [Custom Check - Features](https://docs.cegedim.cloud/display/TDPF/Custom+Check+-+Features).

## Real-world scenario: WordPress

WordPress is the most widely used open source CMS in the world. The following scenarios illustrate how to configure monitoring checks on a WordPress application.

### Scenario 1 — Verify the homepage is available and displays the correct content

**Context**: your WordPress site is in production. You want to be alerted if the homepage stops responding, or if it responds but no longer displays the expected content (database disconnected, broken theme, etc.).

WordPress renders homepage content from the database. If the database goes down, WordPress may return HTTP 200 (page loaded) but display an error such as `"Error establishing a database connection"` instead of normal content. Checking the HTTP status code alone is not sufficient — **you must also verify the content**.

```mermaid
flowchart LR
    A[Probe] -->|GET /| B[WordPress]
    B --> C{HTTP 200?}
    C -->|No - 500:599| F1[❌ CRITICAL\nserver error]
    C -->|Yes| D{Content?}
    D -->|Contains 'Welcome to my site'| OK[✅ OK]
    D -->|Contains 'Error establishing\na database connection'| F2[❌ CRITICAL\ndatabase down]
    D -->|Neither| W[⚠️ WARNING\nunexpected content]
```

#### Custom Check configuration

| Field                | Value                                      | Purpose                   |
| -------------------- | ------------------------------------------ | ------------------------- |
| URL                  | `https://mysite.example.com/`              | Page to monitor           |
| **Expected content** | `Welcome to my site`                       | ✅ If present → OK         |
| **Critical content** | `Error establishing a database connection` | ❌ If present → CRITICAL   |
| **Critical code**    | `500:599`                                  | ❌ Server error → CRITICAL |

#### External Custom Check configuration

| Field                 | Value                         | Purpose                        |
| --------------------- | ----------------------------- | ------------------------------ |
| URL                   | `https://mysite.example.com/` | Page to monitor                |
| **Detection method**  | `Pass if`                     | ✅ If in range and content → OK |
| **Status on content** | `Welcome to my site`          | Text to find in response body  |
| **Status on code**    | `200:299`                     | Acceptable HTTP status range   |

#### Results comparison

| Situation                                     | Custom Check | External Custom Check                      |
| --------------------------------------------- | ------------ | ------------------------------------------ |
| Site OK, correct content                      | ✅ OK         | ✅ OK from Marseille and Paris              |
| Database down (HTTP 200 but wrong content)    | ❌ CRITICAL   | ❌ CRITICAL from Marseille and Paris        |
| Server down (HTTP 500)                        | ❌ CRITICAL   | ❌ CRITICAL from Marseille and Paris        |
| Site OK internally but unreachable from Paris | ✅ OK         | ❌ CRITICAL from Paris only → network issue |

***

### Scenario 2 — Verify that two-factor authentication (2FA) is working

**Context**: your WordPress uses a 2FA plugin (e.g. WP 2FA). Login is a two-step process: credentials → then OTP code. You want to verify that the authentication endpoint responds correctly and that the login flow is not broken.

Rather than testing with a real OTP code, the check verifies that the login page properly presents the 2FA challenge — confirming the mechanism is active and functional.

> 💡 This pattern — verifying that a security mechanism **correctly presents its challenge** — is a standard monitoring technique. The absence of the OTP form is the alert signal.

```mermaid
flowchart LR
    A[Probe] -->|GET /wp-login.php| B[WordPress 2FA]
    B --> C{HTTP status?}
    C -->|500:599| F1[❌ CRITICAL\nserver down]
    C -->|200| D{Content?}
    D -->|Contains 'Authenticator Code'| OK[✅ OK\n2FA active and functional]
    D -->|Absent| W[⚠️ WARNING\n2FA potentially bypassed]
```

#### Custom Check configuration

| Field                | Value                                     | Purpose                                        |
| -------------------- | ----------------------------------------- | ---------------------------------------------- |
| URL                  | `https://mysite.example.com/wp-login.php` | Auth endpoint to monitor                       |
| **Expected content** | `Authenticator Code`                      | ✅ 2FA form is displayed → OK                   |
| **Critical content** | `500:599`                                 | ❌ Server error → CRITICAL                      |
| **Critical code**    | `200:200`                                 | ⚠️ Unexpected HTTP 200 → 2FA might be bypassed |

#### External Custom Check configuration

| Field                 | Value                                     | Purpose                        |
| --------------------- | ----------------------------------------- | ------------------------------ |
| URL                   | `https://mysite.example.com/wp-login.php` | Auth endpoint to monitor       |
| **Detection method**  | `Pass if`                                 | ✅ If in range and content → OK |
| **Status on content** | `Authenticator Code`                      | Expected text in response      |
| **Status on code**    | `!= 5xx`                                  | Server success range           |

#### Results comparison

| Situation                                  | Custom Check | External Custom Check               |
| ------------------------------------------ | ------------ | ----------------------------------- |
| Login OK, 2FA challenge displayed          | ✅ OK         | ✅ OK from Marseille and Paris       |
| 2FA plugin disabled (login without OTP)    | ⚠️ WARNING   | ❌ CRITICAL (pattern absent)         |
| Auth server down (HTTP 500)                | ❌ CRITICAL   | ❌ CRITICAL from Marseille and Paris |
| Auth OK internally, unreachable externally | ✅ OK         | ❌ CRITICAL → network exposure issue |

***

## Summary — When to use which?

| Need                                        | Custom Check           | External Custom Check |
| ------------------------------------------- | ---------------------- | --------------------- |
| Monitor that a page responds                | ✅                      | ✅                     |
| Verify response content                     | ✅                      | ✅                     |
| Detect internal application failure         | ✅                      | ✅                     |
| Simulate real user access from the internet | ❌                      | ✅                     |
| Detect network/CDN/DNS issues               | ❌                      | ✅                     |
| Get per-location results                    | ❌                      | ✅                     |
| Included at no extra cost                   | ✅ (with Load Balancer) | ❌ Paid option         |

> 💡 **Recommendation**: use both. Custom Check monitors application health continuously at no extra cost. External Custom Check ensures your real users can actually reach your application from the internet.
>
> To subscribe to External Custom Check, contact your **SDM**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://academy.cegedim.cloud/monitoring/custom-check/custom-check-get-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
