Skip to content

feat: Add Icinga2 Provider to Push Monitoring Alerts from Icinga2 to Keep #4728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,21 @@
Graylog
</a>
</td>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/icinga2-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/icinga2-icon.png" alt="Icinga2"/>
<br/>
Icinga2
</a>
</td>
</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/kibana-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/kibana-icon.png" alt="Kibana"/><br/>
Kibana
</a>
</td>
</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/libre_nms-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/libre_nms-icon.png" alt="LibreNMS"/><br/>
Expand Down Expand Up @@ -261,15 +268,15 @@
OpenSearch Serverless
</a>
</td>

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/parseable-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/parseable-icon.png" alt="Parseable"/><br/>
Parseable
</a>
</td>

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/pingdom-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/pingdom-icon.png" alt="Pingdom"/><br/>
Expand Down Expand Up @@ -300,15 +307,15 @@
SignalFX
</a>
</td>
<td align="center" width="150">

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/openobserve-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/openobserve-icon.png" alt="OpenObserve"/><br/>
OpenObserve
</a>
</td>

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/site24x7-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/site24x7-icon.png" alt="Site24x7"/><br/>
Expand Down Expand Up @@ -339,15 +346,15 @@
ThousandEyes
</a>
</td>
<td align="center" width="150">

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/uptimekuma-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/uptimekuma-icon.png" alt="UptimeKuma"/><br/>
UptimeKuma
</a>
</td>

</tr>
<tr>
<td align="center" width="150">
<a href="https://docs.keephq.dev/providers/documentation/victorialogs-provider" target="_blank">
<img width="40" src="keep-ui/public/icons/victorialogs-icon.png" alt="VictoriaLogs"/><br/>
Expand Down
1 change: 1 addition & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"providers/documentation/graylog-provider",
"providers/documentation/grok-provider",
"providers/documentation/http-provider",
"providers/documentation/icinga2-provider",
"providers/documentation/ilert-provider",
"providers/documentation/incidentio-provider",
"providers/documentation/incidentmanager-provider",
Expand Down
122 changes: 122 additions & 0 deletions docs/providers/documentation/icinga2-provider.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: "Icinga2 Provider"
sidebarTitle: "Icinga2"
description: "Icinga2 Provider Allows Reception of Push Alerts from Icinga2 to Keep."
---
import AutoGeneratedSnippet from '/snippets/providers/icinga2-snippet-autogenerated.mdx';

<AutoGeneratedSnippet />

import ProviderLogo from '@components/ProviderLogo';

<ProviderLogo src="/icons/icinga2-icon.png" alt="Icinga2 Logo" />

# Icinga2 Provider

The Icinga2 provider allows you to receive alerts from Icinga2 monitoring system within Keep.
Icinga2 provider supports 2 methods for recieving alerts; Webhooks & API Polling.

The recommended and primary method for receiving alerts is via Webhooks.

## Setup

### Prerequisites
1. Access to an Icinga2 instance
2. API user with relevant permissions
3. Keep instance with webhook capability

### Configuration

The provider requires the following configuration:

```yaml
authentication:
host_url: "https://icinga2.example.com" # Your Icinga2 instance URL
api_user: "your-api-user" # Icinga2 API username
api_password: "your-api-password" # Icinga2 API password
```

### Webhook Configuration
To configure Icinga2 to send alerts to Keep via webhooks:

1. Navigate to your Icinga2 configuration directory
2. Create or edit the ```eventcommands.conf``` file
3. Add the following event command configuration:

```plaintext
object EventCommand "keep-notification" {
command = [ "curl" ]
arguments = {
"-X" = "POST"
"-H" = "Content-Type: application/json"
"-H" = "X-API-KEY: ${keep_api_key}"
"--data" = "{
\"host\": {
\"name\": \"$host.name$\",
\"display_name\": \"$host.display_name$\",
\"check_command\": \"$host.check_command$\",
\"acknowledgement\": \"$host.acknowledgement$\",
\"downtime_depth\": \"$host.downtime_depth$\",
\"flapping\": \"$host.flapping$\"
},
\"service\": {
\"name\": \"$service.name$\",
\"display_name\": \"$service.display_name$\",
\"check_command\": \"$service.check_command$\",
\"acknowledgement\": \"$service.acknowledgement$\",
\"downtime_depth\": \"$service.downtime_depth$\",
\"flapping\": \"$service.flapping$\"
},
\"check_result\": {
\"exit_status\": \"$service.state$\",
\"state\": \"$service.state_text$\",
\"output\": \"$service.output$\",
\"execution_start\": \"$service.last_check$\",
\"execution_end\": \"$service.last_check$\",
\"state_type\": \"$service.state_type$\",
\"attempt\": \"$service.check_attempt$\",
\"execution_time\": \"$service.execution_time$\",
\"latency\": \"$service.latency$\"
}
}"
"${keep_webhook_url}" = {
required = true
}
}
}
```
4. Define variables in your Icinga2 Configuration:
- ```keep_api_key```: Your Keep API key with webhook role
- ```keep_webhook_url```: Your Keep Webhook URL
5. Create a notification rule that uses this event command
6. Restart Icinga2 to apply changes

### State Mapping

By Default, Icinga2 states are automatically mapped to Keep alert severities & statuses as follows:

<TableWrapper>
#### Status Mapping
| Icinga2 State | Keep Status |
|:--------------|:------------|
| OK | RESOLVED |
| WARNING | FIRING |
| CRITICAL | FIRING |
| UNKNOWN | FIRING |
| UP | RESOLVED |
| DOWN | FIRING |

</TableWrapper>

<TableWrapper>
#### Severity Mapping
| Icinga2 State | Keep Severity |
|:--------------|:--------------|
| OK | INFO |
| WARNING | WARNING |
| CRITICAL | CRITICAL |
| UNKNOWN | INFO |
| UP | INFO |
| DOWN | CRITICAL |

</TableWrapper>
8 changes: 8 additions & 0 deletions docs/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ By leveraging Keep Providers, users are able to deeply integrate Keep with the t
}
></Card>

<Card
title="Icinga2"
href="/providers/documentation/icinga2-provider"
icon={
<img src="https://img.logo.dev/icinga.com?token=pk_dfXfZBoKQMGDTIgqu7LvYg" />
}
></Card>

<Card
title="ilert"
href="/providers/documentation/ilert-provider"
Expand Down
17 changes: 17 additions & 0 deletions docs/snippets/providers/icinga2-snippet-autogenerated.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{/* This snippet is automatically generated using scripts/docs_render_provider_snippets.py
Do not edit it manually, as it will be overwritten */}

## Authentication
This provider requires authentication.
- **host_url**: Icinga2 Host URL (required: True, sensitive: False)
- **api_user**: Icinga2 API User (required: True, sensitive: False)
- **api_password**: Icinga2 API Password (required: True, sensitive: True)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:
- **read_alerts**: Read alerts from Icinga2



## In workflows

This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues).
Binary file added keep-ui/public/icons/icinga2-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading