# Checkmk

Follow the steps below to configure a service so as to extract its related alert data from Checkmk, which is built on top of Nagios.

Squadcast will then process this information to create incidents for this service as per your preferences.

{% hint style="info" %}
**Note:**

Note that you must be logged in as `root` to complete the installation.
{% endhint %}

These instructions might need to be altered based on your exact Linux distribution and your Checkmk version and configuration.

Please drop our [**Support Team**](mailto:support@squadcast.com) a line if you have any trouble completing the integration

## Using Checkmk as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **Checkmk**. Copy the displayed **Webhook URL** to [configure](#steps-for-integrating-checkmk) it within **Checkmk**. Finish by clicking **Add Alert Source** -> **Done**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-46fe456cd433b8b4477aaa36c0fa8d0f6af9785b%2FCheckmk.png?alt=media\&token=bc388cd1-82da-4630-9a32-6513048eaac5)

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources. You can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.\
\
An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

## Steps for integrating Checkmk

* Go to your Checkmk server.
* Download the Squadcast notification script.

```
wget https://raw.githubusercontent.com/SquadcastHub/squadcast-checkmk-script/master/sq-script.py
```

* Move the notification script into place.

For the standalone version of Checkmk, this is usually in the below path:

`/usr/share/check_mk/notifications`

```
mv sq-script.py /usr/share/check_mk/notifications
```

For the OMD version of Checkmk, this is usually located in `/omd/sites/{site-name-here}/local/share/check_mk/ notifications`.

```
mv sq-script.py /omd/sites/{site-name-here}/local/share/check_mk/notifications
```

* Then give the script execute permission.

```
chmod +x sq-script.py
```

* Log in to the Checkmk web interface, go to **Users** (located in the WATO· Configuration box) and click **New User**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a496d2d2f188c8038510258a3c9755c7abb24acf%2Fcheckmk_2.png?alt=media\&token=3e5ed62a-74bb-42cb-bab7-8a50b9b03362)

* Enter a Username and, optionally, a Full name for the Squadcast user.

{% hint style="info" %}
**Pro Tip:**

You will find it beneficial to set the full name to match the name of your Squadcast service if you will plan to configure Checkmk hosts and services to alert multiple Squadcast services and not just one.
{% endhint %}

* Do not enter a password for this user; instead **check** `disable the login to this account`. This step is done as this account exists solely to send notifications to the Squadcast script.
* Set the user’s role to `Normal monitoring user`, or any custom role you’ve created with permissions to send notifications.
* Add the user to the Contact Groups which are a part of the hosts/services that you want to receive alerts for. Click **Save** when you are done.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-95bc9753ec216d47391848c46863515844374d02%2Fcheckmk_3.png?alt=media\&token=e03894f0-c668-40c4-b887-ae6cd8347bab)

* Click the Notifications icon (bell icon) for the user created.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d3b6c42c6319ee6cf0f7de4470e4914830dbf79d%2Fcheckmk_4.png?alt=media\&token=6bf9c9a2-950d-4e15-b599-7da6300b22e9)

* Enter a **Description** for the new notification method, then set **Notification Method** to **Squadcast**.
* Paste the Webhook URL you copied from Squadcast earlier in the text box that appears once you select **Squadcast**, and select any desired conditions to limit the alerts that get sent to Squadcast. Click **Save** when you are done.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-70c6c9f837b754087aeb7556aecd89068f06580a%2Fcheckmk_5.png?alt=media\&token=0a56f7ee-6011-4441-af65-77274dca1043)

* Go back to the Users list and click **Changes**, then click **Activate Changes**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-efc7af1d24c436c42af09295c0d428f8b0533836%2Fcheckmk_6.png?alt=media\&token=fe680cc4-56ad-4b26-887a-b258ca7d61ea)

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-05a9967735289c17f39de133b214ef49775408d2%2Fcheckmk_7.png?alt=media\&token=7f90d990-fd87-4f3b-8309-c4c64c53b7a1)

* Congratulations! When you see **"Configuration successfully activated"** you are done! Checkmk will now be able send alerts into Squadcast.

### Testing the Checkmk Integration

You can test the integration to make sure everything works as expected by going to a host or service in the Checkmk interface and clicking the Execute icon (hammer).

* In the Fake check results box, click **Critical** (if on a service) or **Down** (if on a host), then click `Yes!` to confirm that you want to send the fake alert.
* You should see a new incident created in Squadcast.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-37f4336e4ac9f6b4e2412d953dc0834d42ba2ac6%2Fcheckmk_8.png?alt=media\&token=1f5547b1-e225-4c7f-997f-4814c5f92156)

{% hint style="info" %}
**Note:**

This integration has been tested with Checkmk version 1.6. However, this integration should work with other existing versions as well, just with slight UI differences.
{% endhint %}

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
