# Checkmk Integration

[Checkmk](https://checkmk.com/) is an enterprise-grade monitoring platform used to monitor servers, applications, networks, and cloud infrastructure. By installing a custom notification script on your Checkmk site, you can forward host and service alerts directly to ITOC360 and trigger your on-call escalation policies in real time.

### Provider Configuration & Mapping

ITOC360 uses the `notification_type` field from the Checkmk payload to determine the alert type.

| Checkmk Notification Type | ITOC360 Type |
| ------------------------- | ------------ |
| `PROBLEM`                 | ALERT        |
| `RECOVERY`                | RESOLVE      |

Priority is read from the `severity` field, which maps to the Checkmk host severity environment variable.

| Checkmk Severity | ITOC360 Priority |
| ---------------- | ---------------- |
| `OK`             | LOW              |
| `WARNING`        | MEDIUM           |
| `CRITICAL`       | CRITICAL         |

### Setup Instructions

#### Step 1: Get Your Webhook URL and Token

1. Log in to your ITOC360 platform.
2. Go to **Sources → Add Source**.
3. Select **Checkmk** as your provider.
4. Save the configuration and copy the generated **Token**.

#### Step 2: Install the Notification Script

The ITOC360 notification script must be placed in the Checkmk notifications directory on your Checkmk server.

Create the file at the following path:

```
~/local/share/check_mk/notifications/itoc360.sh
```

Paste the following content into the file:

```bash
#!/bin/bash
curl -s -X POST "https://api.itoc360.app/functions/v1/events?token=$NOTIFY_PARAMETER_1" \
  -H "Content-Type: application/json" \
  -d "{
    \"host\": \"$NOTIFY_HOSTNAME\",
    \"service\": \"$NOTIFY_SERVICEDESC\",
    \"state\": \"$NOTIFY_SERVICESTATE\",
    \"host_state\": \"$NOTIFY_HOSTSTATE\",
    \"notification_type\": \"$NOTIFY_NOTIFICATIONTYPE\",
    \"output\": \"$NOTIFY_SERVICEOUTPUT\",
    \"host_output\": \"$NOTIFY_HOSTOUTPUT\",
    \"severity\": \"$NOTIFY_HOSTSEVERITY\",
    \"timestamp\": \"$NOTIFY_SHORTDATETIME\"
  }"
```

Then make the script executable:

```bash
chmod +x ~/local/share/check_mk/notifications/itoc360.sh
```

#### Step 3: Create a Notification Rule

1. In Checkmk, go to **Setup → Events → Notifications**.
2. Click **Add notification rule**.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FMfntNXSBA5cK5bWdnYYa%2FWhatsApp%20Image%202026-04-07%20at%2001.36.24.jpeg?alt=media&#x26;token=9cbea65e-2018-4922-b510-fdd822806004" alt=""><figcaption></figcaption></figure>

3. In **Triggering events**, leave the defaults (host DOWN/UP, service CRIT/WARN/OK).
4. In **Notification method (plug-in)**, select `itoc360.sh` from the dropdown.
5. Click **Create** next to the parameters field.
6. In the **New itoc360.sh parameter** dialog:
   * **Description:** Enter a name (e.g. `ITOC360`)
   * **Parameters:** Paste your ITOC360 token copied from Step 1
   * Click **Save**
7. Select the saved parameter from the dropdown.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FkDnosRgSbr5Cw1AONal8%2FWhatsApp%20Image%202026-04-07%20at%2001.37.21.jpeg?alt=media&#x26;token=6650a9a8-b736-48ed-a3b8-7bcd657db9a6" alt=""><figcaption></figcaption></figure>

8. In **Recipient**, select **All users** or the specific users you want to notify.
9. Click through the remaining steps and save the rule.

#### Step 4: Test the Integration

1. Go to **Setup → Events → Notifications → Test notifications**.
2. Select a **Host** from your monitored devices.
3. Set **Simulate** to **Status change → From UP to DOWN**.
4. Check **Trigger notification for a specific method** and select `itoc360.sh` with your parameter.
5. Click **Test notifications**.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FDqdjiOClOQyIjvVJynwC%2FWhatsApp%20Image%202026-04-07%20at%2001.37.10.jpeg?alt=media&#x26;token=e40d9546-95bc-4ce0-b9a8-88af78a8a8dc" alt=""><figcaption></figcaption></figure>

6. A green **Test results** box will confirm that the notifications were triggered.

<figure><img src="https://4108595529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FimJRSa33y5Ej6rwXrBeA%2Fuploads%2FWFNsUTuCf0uEkvekdPHA%2FWhatsApp%20Image%202026-04-07%20at%2001.36.54.jpeg?alt=media&#x26;token=d47325ae-b2ac-4f25-9e7f-ef509778e096" alt=""><figcaption></figcaption></figure>

7. Log in to ITOC360 and go to **Alerts** to verify the alert was received.
