Skip to content

Commit

Permalink
Create playbook and rulebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jryburn committed Feb 7, 2024
1 parent 189159c commit 4fdd7f3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
23 changes: 23 additions & 0 deletions playbooks/example_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"CompanyID": 24761,
"CurrentState": "n/a",
"Description": "Insight for Through Site Comparison",
"Dimensions": {},
"EndTime": "2022-11-02 13:50:00 UTC",
"InsightDataSourceType": "ksql",
"InsightID": "k654321097",
"InsightName": "operate.site.bpsThroughWeekOverWeek",
"InsightPlainDescription": "Foobar Amsterdam AMS13 had 22% more through traffic (+139 Kbits/s) this week compared to last week.",
"IsActive": true,
"Links": {
"InsightDetailsURL": "https://portal.kentik.com/v4/operate/insights/k611587433",
"InsightsMainURL": "https://portal.kentik.com/v4/operate/insights",
"InsightsSeverityURL": "https://portal.kentik.com/v4/operate/insights?severities=notice"
},
"Metrics": {},
"PreviousState": "n/a",
"StartTime": "2022-11-02 11:50:00 UTC",
"Type": "EVENT_VIEW_TYPE_INSIGHT",
"issue": [],
"statistic": {}
}
7 changes: 7 additions & 0 deletions playbooks/example_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Kentik event-driven-ansible test
hosts: localhost # use for local testing of the plugin
tasks:
- name: Print Kentik alert
ansible.buitlin.debug:
msg: "{{ ansible_eda.event.payload }}"
22 changes: 22 additions & 0 deletions rulebooks/kentik_alert_example_rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: Listen for alerts using kentik_webhook
hosts: all

## Define our source for events

sources:
- kentik.ansible_eda.kentik_webhook:
host: 0.0.0.0
port: 80

## Define the conditions we are looking for

rules:
- name: Say Hello
condition: event.i == 1

## Define the action we should take should the condition be met

action:
run_playbook:
name: playbooks/example_playbook.yml

0 comments on commit 4fdd7f3

Please sign in to comment.