Giter Site home page Giter Site logo

flamingzombies's Introduction

Flaming Zombies

A simple yet extendable, lightweight monitoring daemon.

  • Made for the command line.
  • Configured with flat files.
  • Complete documentation in man pages.
  • Few dependencies.
  • Stateless¹.
  • Easily extended, and customised.
  • Liberal 2-clause BSD license.
1. State of course exists, but it isn't persisted between restarts.

THIS IS STILL A WORK IN PROGRESS... but it's ready to test.


Flaming Zombies ties together three components with three distinct responsibilities; tasks, notifiers and gates.

  • tasks check whether a condition is true or false, like if a host responds to pings?
  • notifiers raise alerts.
  • gates control when a notifier may execute.
sequenceDiagram
    task->>+notifier: new measurement
    notifier->>gate: are you open?
    gate->>+notifier: no
    task->>+notifier: new measurement
    notifier->>gate: are you open?
    gate->>+notifier: yes
    notifier->>Human: notification sent
Loading

You're expected to have many tasks. Each task can have one or more notifiers. Each notifier can have one or more gates.

And that is the basis of Flaming Zombies.

Documentation

The complete documentation is available in the man pages. You can read them in your shell before they're installed using using the command:

curl https://raw.githubusercontent.com/jonhiggs/flamingzombies/main/man/man1/fz.1 | man /dev/stdin

Building

Before you can build fz and fzctl, you'll need to have Go installed on your system.

To build, run:

go build ./cmd/fzctl/fzctl.go
go build ./cmd/fz/fz.go

That will produce the binaries for your system. The plugins are at ./libexec and the man pages are at ./man. Adapting the OpenBSD installation instructions should get you a long way to installing it on most UNIX-like system. You may find an init script for your operating system at ./scripts. If you end up writing one, I would appreciate it if you could share it back.

Installation

Installation is intended to be very simple. Eventually, I'd like to provide installation packages, but until then a manual process will need to suffice.

OpenBSD

The below sequence of commands will install the daemon on OpenBSD:

## fz
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/fz_openbsd_${ARCH} \
    -O /usr/local/bin/fz

chown root:wheel /usr/local/bin/fz
chmod 755 /usr/local/bin/fz

## fzctl
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/fzctl_openbsd_${ARCH} \
    -O /usr/local/bin/fzctl

chown root:wheel /usr/local/bin/fzctl
chmod 755 /usr/local/bin/fzctl

## rc script
wget https://raw.githubusercontent.com/jonhiggs/flamingzombies/main/scripts/openbsd_rc \
    -O /etc/rc.d/flamingzombies

chown root:wheel /etc/rc.d/flamingzombies
chmod 755 /etc/rc.d/flamingzombies

## plugins
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/plugins.tar.gz \
    -O /tmp/plugins.tar.gz

tar -C /usr/local/libexec -zxvf /tmp/plugins.tar.gz
rm /tmp/plugins.tar.gz

## man pages
for m in man1/fz.1 man1/fzctl.1 man5/flamingzombies.toml.5 man7/fz-gates.7 man7/fz-notifiers.7 man7/fz-tasks.7; do
    wget https://raw.githubusercontent.com/jonhiggs/flamingzombies/main/man/$f \
        -O /usr/local/man/$f
done

## config
# create a configuration at /etc/flamingzombies.toml
# see the flamingzombies.toml(5) man page.

## enable the daemon
rcctl enable flamingzombies
rcctl set flamingzombies logger daemon.info

Alpine Linux

The below sequence of commands will install the daemon on Alpine Linux:

## fz
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/fz_linux_${ARCH} \
    -O /usr/local/bin/fz

chown root:root /usr/local/bin/fz
chmod 755 /usr/local/bin/fz

## fzctl
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/fzctl_linux_${ARCH} \
    -O /usr/local/bin/fzctl

chown root:root /usr/local/bin/fzctl
chmod 755 /usr/local/bin/fzctl

## rc script
wget https://raw.githubusercontent.com/jonhiggs/flamingzombies/main/scripts/openrc \
    -O /etc/init.d/flamingzombies

chown root:root /etc/init.d/flamingzombies
chmod 755 /etc/init.d/flamingzombies

## plugins
wget https://github.com/jonhiggs/flamingzombies/releases/download/${VERSION}/plugins.tar.gz \
    -O /tmp/plugins.tar.gz

mkdir -p /usr/local/libexec
tar -C /usr/local/libexec -zxvf /tmp/plugins.tar.gz
rm /tmp/plugins.tar.gz

## man pages
for i in $(seq 1 7); do
    mkdir -p "/usr/local/man/man$i"
done

for m in man1/fz.1 man1/fzctl.1 man5/flamingzombies.toml.5 man7/fz-gates.7 man7/fz-notifiers.7 man7/fz-tasks.7; do
    wget https://raw.githubusercontent.com/jonhiggs/flamingzombies/main/man/$f \
        -O /usr/local/man/$f
done

## config
# create a configuration at /etc/flamingzombies.toml
# see the flamingzombies.toml(5) man page.

## enable the daemon
rc-update add flamingzombies
service flamingzombies start

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.