Git Product home page Git Product logo

broker's Introduction

Statusengine naemon/nagios broker module

The Statusengine Broker Module is a small c++ library that gets loaded into your Naemon or Nagios Core.

It will grab all status information, encode them as JSON, and put them into the Gearman Job Server or RabbitMQ. Due to the queuing engine (Gearman or RabbitMQ) your Monitoring Core will not get blocked by a slow database or disk io issues. It is highly recommended to run the Gearman Job Server on the same node as the monitoring core.

Visit the documentation for more information about Statusengine C++ Broker Module

Build and Installation

Please compile and install the newest version of naemon or nagios. We need the header files for building the broker.

Dependencies

Meson

https://mesonbuild.com/Getting-meson.html

Ubuntu/Debian

apt install git python3-pip gcc g++ cmake build-essential libglib2.0-dev libgearman-dev uuid-dev libuchardet-dev libjson-c-dev pkg-config libssl-dev librabbitmq-dev
pip3 install meson ninja

CentOS

yum install git python-pip gcc gcc-c++ cmake3 pkgconfig librabbitmq-devel libgearman-devel libuchardet-devel json-c-devel openssl-devel glib2-devel
pip install meson ninja

Sources

cd /tmp
git clone https://github.com/statusengine/broker
cd broker

Naemon

Please make sure you have set up Naemon like described in the docs.

Then create the make files

export PKG_CONFIG_PATH=/opt/naemon/lib/pkgconfig/
meson setup --buildtype=release build
ninja -C build

Nagios

Please make sure you have set up Nagios like described in the docs.

Ubuntu/Debian

meson setup -Dnagios=true -Dnagios_include_dir=/opt/nagios/include build

RHEL/CentOS

meson setup -Dnagios=true -Dnagios_include_dir=/opt/nagios/include build

Build

ninja -C build

Installation

ninja -C build install

Additional meson build flags

Installation path

The default installation path for the library is /usr/local, which means that the so file will be placed under /usr/local/lib/libstatusengine.so.

You can specify --prefix=/opt/naemon as meson argument to change the path.

Disable RabbitMQ or Gearman

You can specify -Dgearman=false or -Drabbitmq=false as meson argument to disable gearman or rabbitmq.

Configuration

Per default everything is disabled and the broker does nothing.

You can look at statusengine.toml as an example configuration file. In your naemon.cfg/nagios.cfg you have to specify the broker module like this:

broker_module=/opt/naemon/lib/libstatusengine.so /path/to/statusengine.toml

Developer build + test

If you want to build and test the broker, you can use the docker-compose configuration:

docker-compose up --build

This will create docker containers with naemon, rabbitmq and gearman. The broker module will be build on the naemon container. The up command will also run the containers, so you can test if it works.

For deeper inspection you can switch into the naemon container on a second console:

docker exec -t -i broker_naemon_1 /bin/bash

I have also placed a small script inside the container that shows you the queue status of rabbitmq and gearman:

docker exec -t -i broker_naemon_1 /usr/bin/queuestatus

License

statusengine - the missing event broker
Copyright (C) 2019  The statusengine team

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

broker's People

Contributors

jabdr avatar nook24 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.