Skip to content

Instantly share code, notes, and snippets.

View shantanoo-desai's full-sized avatar

Shan Desai shantanoo-desai

View GitHub Profile
@shantanoo-desai
shantanoo-desai / udf_alert.tick
Created March 15, 2019 18:32
TICK Scripts for Kapacitor v1.5. Log critical alerts in a file + store updated data in Database + send data to HTTP Endpoint
var data = batch
|query('SELECT * FROM "telegraf_test"."autogen"."humid"')
.period(20s)
.every(20s)
data
@hash()
.field('v')
|alert()
.crit(lambda: TRUE)
@shantanoo-desai
shantanoo-desai / udf_test.py
Last active March 15, 2019 18:04
Custom Python UDF Example for Kapacitor
from kapacitor.udf.agent import Agent, Handler
from kapacitor.udf import udf_pb2
import logging
import json
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s:%(name)s: %(message)s')
logger = logging.getLogger()
class GeoTestHandler(Handler):
@shantanoo-desai
shantanoo-desai / influxdb-python.inc
Last active September 27, 2018 14:41
[Working Recipes] pynmea2 and influxdb-python recipes created using devtool. Structure followed like that of the meta-python branch in openembedded.
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully func
# (Feel free to remove these comments when editing.)
#
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=046523829184aac3703a4c60c0ae2104"
HOMEPAGE = "https://github.com/influxdb/influxdb-python"