Giter Club home page Giter Club logo

plumon's Introduction

Quickstart | Configuration | Plugins | Adding plugins

plumon


A clojure service mainly used for monitoring which supports user-defined plugins.

plumon supports getting metrics through: polling, some push mechanism (like redis pubsub, or rethinkdb). plumon at the moment can output metrics to riemann. However, in the future, i'm planning to add additional targets.

plumon makes use of plugins in order to make it easy for a user to get his/her metric to riemann/graphite.

The way i typically use it, is to have plumon feed metrics to riemann. riemann does some basic filtering and sends any alerts to slack/email etc.., riemann then sends certain metrics to graphite. grafana is then used as a dashboard.

I've also include the docker compose config file that i use.

More on plugins and how to create your own below.

Quickstart

	# configure ip addresses and port numbers in devcfg/procfg.clj
	# setup up graphite ip address in riemann.config
	# from the shell
	# start docker containers using docker-compose
	$ docker-compose up
	# configure
	# start plumon (sudo needed in this case due to ping requiring it)
	$ sudo BOOT_AS_ROOT=yes boot dev-run

Configuration

The following variables are configurable and also optional:

  • redis ip address/port (located in devcfg/prodcfg.clj)
  • riemann ip address/port (located in devcfg/prodcfg.clj)
  • rethinkdb ip address/port (located in devcfg/prodcfg.clj)
  • riemann ip address/port (located in riemann.config)
  • you can add other configurations like tokens, keys etc..

Plugins

Plugin basics

A plugin is a functions that gets invoked by plumon every configurable numbers of second (if polled), or is called as a callback for a push type plugin.

Plugins reside in the plugins directory as a separate clojure namespace. In order to start using a plugin you would need to declare how it's configured in the plugins.edn file in the resources directory.

plugins.edn

Defines how a plugin would get invoked by plumon:

 {:description "redis plugin"
  :run plumon.plugins.redis/run
  :type :riemann
  :kind :redis
  :event {:service "redis test metric"
          :description "some redis test metric"
          :tags ["redis"]}
  :options {:timeout 1000
            :args {:host "127.0.0.1"
                   :metric-key "some:redis:metric"}}}

options used in plugins.edn file:

  • description: text description of the plugin.
  • run: clojure namespace of the plugin function to run (in this case we're running the redis plugin run function).
  • type (optional): indicates the type of metric. In this case, we're forwarding the metric to riemann. Defaults to just output to stdout.
  • kind (optional): the kind of metric to run. possible kinds are: :redis-pubsub, :redis, :rethink. Defaults to a polling metric.
  • event (optional) : used in conjuction with riemann. This defines the event that riemann will use to process.
  • options :
    • timeout : timeout in milliseconds. How often to poll metric, applies polling plugins.
    • args : arguments that are passed to the plugin function.

Adding plugins

Plugins can be added by implemeting a function in a separate namespace in the plugins directory.

Here's a simple example of a plugin (in this case, the plugin does nothing more than return a random number):

(ns plumon.plugins.myplugin)

(defn run []
  (let [num (rand-int 1000)]
    (println "myplugin returned: " num)
    num))

In order to use this plugin, you would need to declare it in the plugins.edn and specify how often it should get called, what kind of event would be used if it's sent to riemann etc.. as described above.

plumon's People

Contributors

bass3m avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.