Coder Social home page Coder Social logo

vzmonitor's Introduction

vzmonitor

monitor/alert daemon for volkszaehler.org like sensors

Features:

  • define own "rules" as conditions incl. functions for:
    • comparision operators like >, <=,...
    • min
    • max
    • avg
    • lasttime
    • ...
  • trigger an external script if a rule changes its status
  • support for systemd watchdog

Examples:

  • check whether a sensor/channel is alive: (here at least one value per 10s)
{ "name": "ch1 dead?",
 "condition": {"LTE":[{"+":[10, {"LASTTIME":"ch1"}]},"NOW"]},
 "action": "./test.sh"
}
  • real life example: check whether some water is constantly draining:
{ "name": "water draining?",
 "condition": {"GT":[{"MINVALUE":["water", 900]},0]},
 "action": "Check water! It's draining for more than 15mins!"
}
  • for more see config file

Command line options

Currently supported options:

  • '-V' show version number and exit
  • '-c' file incl. path to config file.
  • '-w' interval for systemd watchdog seconds (if system supports sd_watchdog_enable it will be automatically detected and overwritten)
  • '-h or -?' show help and exit.

Config file options / format

see etc/vzmonitor.conf for an example

To install:

clone to your local machine e.g.

git clone https://github.com/mbehr1/vzmonitor.git

make sure your gcc version is at least 4.7 e.g.

sudo apt-get install g++-4.7
rm /usr/bin/g++
cd /usr/bin
ln -s g++-4.7 /usr/bin/g++)

Preferraby (optional) install libsystemd-daemon-dev to have support for systemd watchdog:

sudo apt-get install libsystemd-daemon-dev

Have libmicrohttpd and libjson-c >= 0.12 installed (todo add howto/example)

cd vzmonitor
mkdir build
cmake ..
make && make test
sudo make install

copy and adjust systemd unit file from /etc to /etc/systemd/system/
copy and adjust config file from /etc to /etc/
sudo systemctl enable vzmonitor.service
sudo systemctl start vzmonitor.service

vzmonitor's People

Contributors

mbehr1 avatar

Stargazers

Balint Deak avatar

Watchers

James Cloos avatar  avatar  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.