Docs
WebsiteLoginFree Trial
  • Getting Started
    • OnCall Users
    • Team Admins
    • Account Admins
  • Architecture Guide
  • Common UI Design Patterns
  • Alerts
  • Teams
  • Schedules
  • Escalation Policies
  • Integrations
  • Broadcasts
  • Users
  • Notifications
  • Reports
  • Billing
  • Accounts
  • Stakeholders
  • Maintenance Windows
  • Routers
  • Notification Rules
  • Single Sign On (SSO)
  • Integration Guides
    • Introduction
    • 66uptime
    • Apex Ping
    • AppDynamics
    • Auvik
    • AWS CloudWatch
    • Azure Monitor
    • Cloudflare
    • Cronitor
    • Datadog
    • Dead Man's Snitch
    • Echoes HQ
    • ElastAlert
    • Email
    • Form
    • Freshdesk
    • Freshservice
    • Google Hangouts Chat
    • Grafana
    • Healthchecks.io
    • HetrixTools
    • Honeybadger
    • Hydrozen
    • Jira Server
    • JotForm
    • Kapacitor
    • LogicMonitor
    • Mattermost
      • Outgoing Webhook
      • Post to Channel
    • Meta Workplace
    • Microsoft Teams
    • New Relic
    • Outgoing Webhook
    • Pingdom
    • Prometheus
    • PRTG Network Monitor
    • Pulsetic
    • Sentry
    • ServerGuard24
    • Site24x7
    • Slack
      • Notifications
      • Outgoing Webhook
      • Post to Channel
    • SolarWinds
    • Stackdriver
    • StatusCake
    • Twilio
      • Incoming SMS
      • Live Call Routing
    • Typeform
    • Uptime
    • Uptime Kuma
    • UptimeRobot
    • Webhook
    • Zendesk
  • API
    • Introduction
    • Authentication
    • Errors
    • Pagination and Filters
    • Common Model Attributes
    • Account Users
    • Alerts
    • Broadcasts
    • Comments
    • Escalation Policies
    • Events
    • Integrations
    • Logs
    • Maintenance Windows
    • Notification Rules
    • Routers
    • Schedules
    • Teams
    • Users
  • Command Line Interface (CLI)
    • PagerTree CLI: Command Line Interface
Powered by GitBook
On this page
  • What is Kapacitor?
  • How It Works
  • Integration Walkthrough
  • In PagerTree
  • In Kapacitor

Was this helpful?

  1. Integration Guides

Kapacitor

Connect your Kapacitor alerts to PagerTree using our Kapacitor Integration.

PreviousJotFormNextLogicMonitor

Last updated 1 year ago

Was this helpful?

Company
Estimated Time
Vendor Docs
Open Source

5 minutes

What is Kapacitor?

is an open source data processing framework that makes it easy to create alerts, run ETL jobs and detect anomalies. It can process both stream and batch data from InfluxDB. It lets you plug in your own custom logic or user-defined functions to process alerts with dynamic thresholds, match metrics for patterns, compute statistical anomalies, and perform specific actions based on these alerts like dynamic load rebalancing.

How It Works

Kapacitor triggers alerts when alert rules are triggered.

  • When an alert is not OK (level !== 'OK') in Kapacitor, an alert is created in PagerTree automatically.

  • When an alert is OK (level === 'OK') in Kapacitor, the alert is resolved in PagerTree automatically.

Integration Walkthrough

In this integration tutorial we will show you how to send alerts from Kapacitor into PagerTree. The estimated time for this integration is 5 minutes. We assume that you already have a PagerTree and Kapacitor setup. We also assume you are familiar with the since we will be using several of these components to setup the Kapacitor integration.

In PagerTree

  1. by clicking the Kapacitor logo.

  2. .

In Kapacitor

  1. From your Chronograph dashboard, in the left hand menu, select Alerting -> Manage Tasks.

  2. Click the Write TICKscript button.

  3. In the TICKscript editor:

    1. Select a database.

    2. Title your TICKscript (e.g. “high_cpu”).

    3. Copy and paste the following code, replacing the pagertree_url value with the PagerTree Endpoint URL you copied earlier.

cpu_alert.tick.js
var pagertree_url = '<PagerTree Endpoint URL>'
var period = 1m
var crit = 90
var warn = 80
var info = 70


var data = stream
   |from()
       .database('telegraf')
       .retentionPolicy('autogen')
       .measurement('win_cpu')
   |window()
       .period(period)
       .every(period)
   |mean('Percent_User_Time')
   |eval(lambda: "mean")
       .as('value')

var trigger = data
   |alert()
       .info(lambda: "value" > info)
       .warn(lambda: "value" > warn)
       .crit(lambda: "value" > crit)
       .stateChangesOnly()
       .message(' is  value: ')
       .id('high_cpu')
       .idTag('alertID')
       .levelTag('level')
       .messageField('message')
       .post(pagertree_url)
  1. Click the Save New TICKscript button.

This tick script, uses InfluxDB’s sample Telegraph collector that merely collects CPU usage on your local machine. You’ll need to apply the alert to your own tickscripts to alert on metrics you wish to monitor.

The important pieces to this script are:

cpu_alert.important.tick.js
...
// will look at windows of data so you are not spammed by every datapoint
|window()
    .period(period)
    .every(period)
...
// send the alert to PagerTree with different levels. Only report state changes.
|alert()
    .info(lambda: "value" > info)
    .warn(lambda: "value" > warn)
    .crit(lambda: "value" > crit)
    .stateChangesOnly() // *very important*
    .message('{{.ID}} is {{.Level}} value: {{ index .Fields "value" }}')
    .id('high_cpu')
    .idTag('alertID')
    .levelTag('level')
    .messageField('message')
    .post(pagertree_url)

You have successfully completed the Kapacitor Integration.


Kapacitor
TICK stack
Create the integration
Copy the Endpoint URL
InfluxData, Inc.
view
v3.rb
Navigate to Alerting -> Manage Tasks
Click the Write TICKscript button.
Select a database.
Save the TICKscript.
Manage Tasks
 Write TICKscript button
database
TICKscript