Skip to content

Commit 022a673

Browse files
Merge branch 'main' into fix/3898-bug-topology-models-pks-are-tenant-agnostic
2 parents 9b51c3d + 0a2cb34 commit 022a673

File tree

126 files changed

+4933
-1342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+4933
-1342
lines changed

Diff for: .github/workflows/auto-resolve-keep.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616
required: false
1717
type: string
1818
default: "resolved"
19-
push:
19+
pull_request:
20+
types: [closed]
2021
branches:
2122
- main
2223

@@ -25,7 +26,7 @@ jobs:
2526
runs-on: ubuntu-latest
2627
steps:
2728
- name: Extract Keep ID from PR description
28-
if: github.event_name == 'push'
29+
if: github.event_name == 'pull_request'
2930
id: extract_id
3031
run: |
3132
PR_DESC="${{ github.event.pull_request.body }}"
@@ -44,7 +45,7 @@ jobs:
4445
4546
- name: Auto resolve Keep incident
4647
if: |
47-
(github.event_name == 'push' && steps.set_ids.outputs.final_incident_id != '') ||
48+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && steps.set_ids.outputs.final_incident_id != '') ||
4849
(github.event_name == 'workflow_dispatch' && inputs.incident_id != '')
4950
uses: fjogeleit/http-request-action@v1
5051
with:
@@ -55,22 +56,22 @@ jobs:
5556

5657
- name: Auto enrich Keep incident
5758
if: |
58-
(github.event_name == 'push' && steps.set_ids.outputs.final_incident_id != '') ||
59+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && steps.set_ids.outputs.final_incident_id != '') ||
5960
(github.event_name == 'workflow_dispatch' && inputs.incident_id != '')
6061
uses: fjogeleit/http-request-action@v1
6162
with:
6263
url: "https://api.keephq.dev/incidents/${{ steps.set_ids.outputs.final_incident_id }}/enrich"
6364
method: "POST"
6465
customHeaders: '{"X-API-KEY": "${{ secrets.KEEP_API_KEY }}", "Content-Type": "application/json"}'
65-
data: '{"enrichments":{"incident_title":"${{ github.event.head_commit.message || ''Manual resolution'' }}","incident_url":"${{ github.event.head_commit.url || format(''{0}/{1}/actions/runs/{2}'', github.server_url, github.repository, github.run_id) }}", "incident_id": "${{ github.run_id }}", "incident_provider": "github"}}'
66+
data: '{"enrichments":{"incident_title":"${{ github.event.pull_request.title || ''Manual resolution'' }}","incident_url":"${{ github.event.pull_request.html_url || github.server_url }}//${{ github.repository }}/actions/runs/${{ github.run_id }}", "incident_id": "${{ github.run_id }}", "incident_provider": "github"}}'
6667

6768
- name: Auto resolve Keep alert
6869
if: |
69-
(github.event_name == 'push' && steps.set_ids.outputs.final_alert_fingerprint != '') ||
70+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && steps.set_ids.outputs.final_alert_fingerprint != '') ||
7071
(github.event_name == 'workflow_dispatch' && inputs.alert_fingerprint != '')
7172
uses: fjogeleit/http-request-action@v1
7273
with:
7374
url: "https://api.keephq.dev/alerts/enrich?dispose_on_new_alert=true"
7475
method: "POST"
7576
customHeaders: '{"Content-Type": "application/json", "X-API-KEY": "${{ secrets.KEEP_API_KEY }}"}'
76-
data: '{"enrichments":{"status":"${{ inputs.status || ''resolved'' }}","dismissed":false,"dismissUntil":"","note":"${{ github.event.head_commit.message || ''Manual resolution'' }}","ticket_url":"${{ github.event.head_commit.url || format(''{0}/{1}/actions/runs/{2}'', github.server_url, github.repository, github.run_id) }}"},"fingerprint":"${{ steps.set_ids.outputs.final_alert_fingerprint }}"}'
77+
data: '{"enrichments":{"status":"${{ inputs.status || ''resolved'' }}","dismissed":false,"dismissUntil":"","note":"${{ github.event.pull_request.title || ''Manual resolution'' }}","ticket_url":"${{ github.event.pull_request.html_url || github.server_url }}//${{ github.repository }}/actions/runs/${{ github.run_id }}"},"fingerprint":"${{ steps.set_ids.outputs.final_alert_fingerprint }}"}'

Diff for: README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@
237237
Kibana
238238
</a>
239239
</td>
240+
<td align="center" width="150">
241+
<a href="https://docs.keephq.dev/providers/documentation/libre_nms-provider" target="_blank">
242+
<img width="40" src="keep-ui/public/icons/libre_nms-icon.png" alt="LibreNMS"/><br/>
243+
LibreNMS
244+
</a>
245+
</td>
240246
<td align="center" width="150">
241247
<a href="https://docs.keephq.dev/providers/documentation/netbox-provider" target="_blank">
242248
<img width="40" src="keep-ui/public/icons/netbox-icon.png" alt="NetBox"/><br/>
@@ -261,14 +267,14 @@
261267
Parseable
262268
</a>
263269
</td>
270+
</tr>
271+
<tr>
264272
<td align="center" width="150">
265273
<a href="https://docs.keephq.dev/providers/documentation/pingdom-provider" target="_blank">
266274
<img width="40" src="keep-ui/public/icons/pingdom-icon.png" alt="Pingdom"/><br/>
267275
Pingdom
268276
</a>
269277
</td>
270-
</tr>
271-
<tr>
272278
<td align="center" width="150">
273279
<a href="https://docs.keephq.dev/providers/documentation/prometheus-provider" target="_blank">
274280
<img width="40" src="keep-ui/public/icons/prometheus-icon.png" alt="Prometheus"/><br/>
@@ -299,14 +305,14 @@
299305
OpenObserve
300306
</a>
301307
</td>
308+
</tr>
309+
<tr>
302310
<td align="center" width="150">
303311
<a href="https://docs.keephq.dev/providers/documentation/site24x7-provider" target="_blank">
304312
<img width="40" src="keep-ui/public/icons/site24x7-icon.png" alt="Site24x7"/><br/>
305313
Site24x7
306314
</a>
307315
</td>
308-
</tr>
309-
<tr>
310316
<td align="center" width="150">
311317
<a href="https://docs.keephq.dev/providers/documentation/splunk-provider" target="_blank">
312318
<img width="40" src="keep-ui/public/icons/splunk-icon.png" alt="Splunk"/><br/>
@@ -337,14 +343,14 @@
337343
VictoriaLogs
338344
</a>
339345
</td>
346+
</tr>
347+
<tr>
340348
<td align="center" width="150">
341349
<a href="https://docs.keephq.dev/providers/documentation/victoriametrics-provider" target="_blank">
342350
<img width="40" src="keep-ui/public/icons/victoriametrics-icon.png" alt="VictoriaMetrics"/><br/>
343351
VictoriaMetrics
344352
</a>
345353
</td>
346-
</tr>
347-
<tr>
348354
<td align="center" width="150">
349355
<a href="https://docs.keephq.dev/providers/documentation/wazuh-provider" target="_blank">
350356
<img width="40" src="keep-ui/public/icons/wazuh-icon.png" alt="Wazuh"/><br/>

Diff for: docker/Dockerfile.api

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
3131
COPY keep keep
3232
COPY ee keep/ee
3333
COPY examples examples
34+
COPY keep-ui/public/icons/unknown-icon.png unknown-icon.png
3435
RUN /venv/bin/pip install --use-deprecated=legacy-resolver . && \
3536
rm -rf /root/.cache/pip && \
3637
find /venv -type d -name "__pycache__" -exec rm -r {} + && \
@@ -42,6 +43,7 @@ ENV VIRTUAL_ENV="/venv"
4243
ENV EE_PATH="ee"
4344
COPY --from=builder /venv /venv
4445
COPY --from=builder /app/examples /examples
46+
COPY --from=builder /app/unknown-icon.png unknown-icon.png
4547
# as per Openshift guidelines, https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images
4648
RUN chgrp -R 0 /app && chmod -R g=u /app && \
4749
chown -R keep:keep /app && \

Diff for: docs/cli/installation.mdx

+14-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ git clone https://github.com/keephq/keep.git && cd keep
2222
Install Keep CLI with `pip`:
2323

2424
```shell
25-
pip install .
25+
# MacOS if python or pip not present:
26+
# brew install [email protected]
27+
# brew install postgresql
28+
pip3.11 install .
2629
```
2730
or with `poetry`:
2831

@@ -36,33 +39,33 @@ From now on, Keep should be installed locally and accessible from your CLI, test
3639
keep version
3740
```
3841

39-
### Test
40-
Get a Slack Incoming Webhook using [this tutorial](https://api.slack.com/messaging/webhooks) and use use Keep to configure it
42+
### Configuration
4143

44+
To get API key, check Keep UI -> your username (bottom left) -> Settings -> API Keys
4245
```
43-
keep config provider --provider-type slack --provider-id slack-demo
46+
keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key
4447
```
45-
Paste the Slack Incoming Webhook URL (e.g. https://hooks.slack.com/services/...) and you're good to go 👌
4648

47-
Let's now execute our example "Paper DB has insufficient disk space" alert
49+
### Test
4850

49-
```bash
50-
keep run --alerts-file examples/workflows/db_disk_space.yml
51+
Now,
52+
```
53+
keep workflow apply -f examples/workflows/query_clickhouse.yml
5154
```
5255

53-
Congrats 🥳 You should have received your first "Dunder Mifflin Paper Company" alert in Slack by now.
56+
Congrats 🥳 Check your UI for the new workflow uploaded from the YAML file.
5457

5558

5659
## Docker image (Option 2)
5760
### Install
5861

5962
```
60-
docker run -v ${PWD}:/app -it us-central1-docker.pkg.dev/keephq/keep/keep-cli config provider --provider-type slack --provider-id slack-demo
63+
docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key
6164
```
6265

6366
### Test
6467
```
65-
docker run -v ${PWD}:/app -it us-central1-docker.pkg.dev/keephq/keep/keep-cli -j run --alert-url https://raw.githubusercontent.com/keephq/keep/main/examples/alerts/db_disk_space.yml
68+
docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli workflow apply -f examples/workflows/query_clickhouse.yml
6669
```
6770

6871

Diff for: docs/images/librenms-provider_1.png

82.2 KB
Loading

Diff for: docs/images/librenms-provider_2.png

111 KB
Loading

Diff for: docs/images/librenms-provider_3.png

105 KB
Loading

Diff for: docs/images/librenms-provider_4.png

72.9 KB
Loading

Diff for: docs/images/librenms-provider_5.png

55.1 KB
Loading

Diff for: docs/images/librenms-provider_6.png

62.3 KB
Loading

Diff for: docs/mint.json

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"providers/documentation/keep-provider",
184184
"providers/documentation/kibana-provider",
185185
"providers/documentation/kubernetes-provider",
186+
"providers/documentation/libre_nms-provider",
186187
"providers/documentation/linear_provider",
187188
"providers/documentation/linearb-provider",
188189
"providers/documentation/llamacpp-provider",

Diff for: docs/providers/documentation/libre_nms-provider.mdx

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: 'LibreNMS'
3+
sidebarTitle: 'LibreNMS Provider'
4+
description: 'LibreNMS allows you to receive alerts from LibreNMS using API endpoints as well as webhooks'
5+
---
6+
7+
## Authentication Parameters
8+
9+
The LibreNMS provider offers two ways to authenticate:
10+
11+
- `LibreNMS Host URL` - This is the URL of your LibreNMS instance.
12+
- `LibreNMS API Key` - This is the API key created in the User Settings of your LibreNMS account and is used to authenticate requests to the LibreNMS API.
13+
14+
## Connecting LibreNMS to Keep
15+
16+
1. Open LibreNMS dashboard and click on settings in the top right corner.
17+
18+
<Frame width="100" height="200">
19+
<img height="10" src="/images/librenms-provider_4.png" />
20+
</Frame>
21+
22+
2. Click on `Create API access token` to generate a new API key.
23+
24+
<Frame width="100" height="200">
25+
<img height="10" src="/images/librenms-provider_5.png" />
26+
</Frame>
27+
28+
3. Give a description to the API key and click on `Create API Token`.
29+
30+
<Frame width="100" height="200">
31+
<img height="10" src="/images/librenms-provider_6.png" />
32+
</Frame>
33+
34+
## Webhooks Integration
35+
36+
1. Open LibreNMS dashboard and open `Alerts` tab in the navigation bar and click on `Alert Transports`.
37+
38+
<Frame width="100" height="200">
39+
<img height="10" src="/images/librenms-provider_1.png" />
40+
</Frame>
41+
42+
2. Click on `Create add transport` and select `Transport type` as `API`. Select the `API Method` as `POST`.
43+
44+
3. Fill the `API URL` with [https://api.keephq.dev/alerts/event/libre_nms](https://api.keephq.dev/alerts/event/libre_nms).
45+
46+
<Frame width="100" height="200">
47+
<img height="10" src="/images/librenms-provider_2.png" />
48+
</Frame>
49+
50+
4. Copy the below JSON and paste it in `body` field.
51+
52+
```json
53+
{
54+
"title": "{{ $title }}",
55+
"hostname": "{{ $hostname }}",
56+
"device_id": "{{ $device_id }}",
57+
"sysDescr": "{{ $sysDescr }}",
58+
"sysName": "{{ $sysName }}",
59+
"sysContact": "{{ $sysContact }}",
60+
"os": "{{ $os }}",
61+
"type": "{{ $type }}",
62+
"ip": "{{ $ip }}",
63+
"display": "{{ $display }}",
64+
"version": "{{ $version }}",
65+
"hardware": "{{ $hardware }}",
66+
"features": "{{ $features }}",
67+
"serial": "{{ $serial }}",
68+
"status": "{{ $status }}",
69+
"status_reason": "{{ $status_reason }}",
70+
"location": "{{ $location }}",
71+
"description": "{{ $description }}",
72+
"notes": "{{ $notes }}",
73+
"uptime": "{{ $uptime }}",
74+
"uptime_short": "{{ $uptime_short }}",
75+
"uptime_long": "{{ $uptime_long }}",
76+
"elapsed": "{{ $elapsed }}",
77+
"alerted": "{{ $alerted }}",
78+
"alert_id": "{{ $alert_id }}",
79+
"alert_notes": "{{ $alert_notes }}",
80+
"proc": "{{ $proc }}",
81+
"rule_id": "{{ $rule_id }}",
82+
"id": "{{ $id }}",
83+
"faults": "{{ $faults }}",
84+
"uid": "{{ $uid }}",
85+
"severity": "{{ $severity }}",
86+
"rule": "{{ $rule }}",
87+
"name": "{{ $name }}",
88+
"string": "{{ $string }}",
89+
"timestamp": "{{ $timestamp }}",
90+
"contacts": "{{ $contacts }}",
91+
"state": "{{ $state }}",
92+
"msg": "{{ $msg }}",
93+
"builder": "{{ $builder }}"
94+
}
95+
```
96+
97+
5. Follow the below steps to create a new API key in Keep.
98+
99+
6. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
100+
101+
<Frame width="100" height="200">
102+
<img height="10" src="/images/keep-apikey-1.png" />
103+
</Frame>
104+
105+
7. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
106+
107+
<Frame width="100" height="200">
108+
<img height="10" src="/images/keep-apikey-2.png" />
109+
</Frame>
110+
111+
8. Give name and select the role as `webhook` and click on `Create API Key`.
112+
113+
<Frame width="100" height="200">
114+
<img height="10" src="/images/keep-apikey-3.png" />
115+
</Frame>
116+
117+
9. Copy the API key.
118+
119+
<Frame width="100" height="200">
120+
<img height="10" src="/images/keep-apikey-4.png" />
121+
</Frame>
122+
123+
10. Add a new header with key as `X-API-KEY` and create a new API key in Keep and paste it as the value and save the webhook.
124+
125+
<Frame width="100" height="200">
126+
<img height="10" src="/images/librenms-provider_2.png" />
127+
</Frame>
128+
129+
11. Save the webhook.
130+
131+
12. You can add devices from the Devices tab in the LibreNMS dashboard and select the alert transport that you have created.
132+
133+
<Frame width="100" height="200">
134+
<img height="10" src="/images/librenms-provider_3.png" />
135+
</Frame>
136+
137+
13. Now, you will receive the alerts in Keep.
138+
139+
## Useful Links
140+
141+
- [LibreNMS](https://www.librenms.org/)

Diff for: docs/providers/overview.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ By leveraging Keep Providers, users are able to deeply integrate Keep with the t
313313
icon={ <img src="https://img.logo.dev/kubernetes.io?token=pk_dfXfZBoKQMGDTIgqu7LvYg" /> }
314314
></Card>
315315

316+
<Card
317+
title="LibreNMS"
318+
href="/providers/documentation/libre_nms-provider"
319+
icon={ <img src="https://img.logo.dev/librenms.org?token=pk_dfXfZBoKQMGDTIgqu7LvYg" /> }
320+
></Card>
321+
316322
<Card
317323
title="Linear"
318324
href="/providers/documentation/linear_provider"

0 commit comments

Comments
 (0)